Mail Archives: djgpp/1998/02/28/19:30:33
Nate Eldredge wrote in message <199802282007 DOT MAA15146 AT adit DOT ap DOT net>...
>At 12:20 2/28/1998 +0100, [iC] wrote:
>>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
> ^^^^^^
>Do you mean `degrees'?
yupp, my english is no good ;-)
>>values vould be -1 both, and if the object has an angel of 90 and speed of
5
> ^^^^^^^^^^^^^^^^^^^^^^^
>No they wouldn't! They would be sqrt(2)/2. See below.
>
>>the y would have the value -5 and x = 0. uhh get the idea ?? ;-)
>
>If you're using standard geometric conventions, y would be +5.
I meant on the screen (0,0 =top left)
>>Have anybody done somthing like this or have any ideas ?
>
>It's simple trigonomentry/vector math. In brief:
>
>x = speed * cos(angle)
>y = speed * sin(angle)
>
sorry, but we have not had about sin and cos at class.....
>Note that to use the C trig functions, you must convert the argument into
>radians. There are (2*pi) radians in a full circle. So:
>
>radians = (degrees * 180) / pi
>
uh, ok ;-)
- Raw text -