Thread: Maths -> Convert Degrees to X/Y Coordinates

1. Maths -> Convert Degrees to X/Y Coordinates

Hey all,
I'm having a lot of trouble with a little project I'm working on.
I'd like to choose a compass bearing (0 - 360) and then move an object in that direction (using X and Y coordinates).

For the first quadrant, I just use trig (tan) to calculate it. But in all the other ones I'm having weird issues. (Tan is the best option because you can calculate the gradient but tan is only positive in two quadrants)
Any tips to point me in the right direction?  Reply With Quote

2. I can't quite picture what you have designed (but I have a fairly good idea), so I'll just answer in general terms.

You've got the (relatively) difficult trig part done. Now you just need to figure out the sign. An easy way to deal with this is to divide the circle into quadrants and work from there-- adjust the sign as needed, and subtract in increments of 90 degrees.

Technically you can probably do this without that and still get the right numbers using tan, but I'm not sure.

Remember the Pythagorean theorem as well, which might help for figuring out X and Y.

Basically just do some trial and error until the signs work out, then the rest should fit into place.  Reply With Quote

3. I assume you've tried cotangent, secant?  Reply With Quote Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•