Mail Archives: djgpp/1998/02/28/17:27:07
In article <6d8rsg$gc4$1 AT o DOT online DOT no>, "[iC]"
<jan AT narvik DOT crosswinds DOT net> writes
>Uh, this might not be the right group to poste this question, but anyway ...
>
>Does anybody knows how to convert speed and angel to +-x and y ?
>like if the angel of the object is 45 grades and speed is one the x and y
>values vould be -1 both, and if the object has an angel of 90 and speed of 5
>the y would have the value -5 and x = 0. uhh get the idea ?? ;-)
>Have anybody done somthing like this or have any ideas ?
This is fairly easy. The equation to give the results requested would
be:
x = -speed * cos(angle)
y = -speed * sin(angle)
These should work fine.
--
Darren Tanner
- Raw text -