Imagine you are sitting at a park. Suddenly your car gets hijacked and being driven in different directions. Here are the directions, arrows show which direction goes towards where:
South | V East-> <-West ^ | North
After being driven, the car stops. Now you have to find out how far the car is away from you and angle of you and your car in degrees. It will be given how many units have been driven and in which direction. Input/Output format is flexible, you can take a 2D list/1D list/string etc and return the displacement and angle.
[[40,East],[40,North],[30,West],[30,South]] -> 14.1421356237 45.0 [[45,North],[200,East]] -> 205.0 75.9637565321
No need to output exact angle and distance, just 2 digits after decimal is fine, but more than 2 is fine too.
Only given directions are North, east, south, west.
The value of movement in a direction is always positive integer.
Trailing Whitespace allowed. Code golf, so shortest code wins.
My English is bad, sorry. Please ask for clarification if you have trouble understand ing