Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: mike_g on March 12, 2007
-
Its kind of embarrasing asking such a simple maths question but:
Say I have a start x/y co-ordinate, an angle in degrees, and a distance. How can I get the end x/y co-ordinates from this?
-
If I remember correctly, you can do it something like this:
endXpos = startXpos + sin( angle ) * distance
endYpos = startYpos + cos( angle ) * distance
-
Thanks man, I'll try that out.
[edit]Yeah works fine :)[/edit]
-
Don't be embarrased asking questions, simple or difficult they keep the board alive :) Have some good karma guys.