Translate 2 Coordinates into Angle

Trigonometric ratios and functions, the unit circle, inverse trig functions, identities, trig graphs, etc.
kydjester
Posts: 2
Joined: Mon Aug 30, 2010 12:06 am
Contact:

Translate 2 Coordinates into Angle

Postby kydjester » Mon Aug 30, 2010 3:26 am

Hello, I'm a newbie to math and I'm trying to work on a video game using XNA from microsoft - just really goofing off.

My problem is how do I Translate 2 coordinates to represent a degree (from 0 to 360).

So, the way it is - is , I have a Xbox Controller and the joystick reports back coordinates from -1 to 1 to X and Y. So in the middle it's Zero and the farthest Y is 1 lowest Y is -1 etc.

How can I take a coordinate like -.863x & -.521y and turn it into a degree between from 0 to 360 . And Vice Versa, how can I take the positive .863x & .521y and turn it to a degree from 0 to 360.

I've attached an image to help visualize: http://imgur.com/idxLu.jpg

Any help is appreciated! Thank you!

User avatar
stapel_eliz
Posts: 1731
Joined: Mon Dec 08, 2008 4:22 pm
Contact:

Postby stapel_eliz » Mon Aug 30, 2010 9:57 am

It sounds like you're wanting to convert the rectangular coordinates into polar coordinates, or at least to find the angle that you would have used for polar coordinates. To learn about how to do that conversion, try here. :wink:

kydjester
Posts: 2
Joined: Mon Aug 30, 2010 12:06 am
Contact:

Re: Translate 2 Coordinates into Angle

Postby kydjester » Tue Aug 31, 2010 12:17 am

Thanks. This was the type of lead I was looking for.


Return to “Trigonometry”