I have a tuple (x, y) with x and y in [-1, 1]. The tuple represents a movement in any direction. I would like to convert this to a 360 degree angle, where 0 represents north.
I have a tuple (x, y) with x and y in [-1, 1]. The
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Depending on what ‘North’ means, i.e. along which axis, and what direction the angles are supposed to go, the following code should be a solution to your problem:
This gives you the angle of a point(x,y) from the origin, counter-clockwise with ‘North’ along the x-axis.