2
$\begingroup$

If I had a position of 0,0 and I had an angle of 45 degrees (or any number) and my velocity was 1 what would be the x,y increase?

For example if I had a 90 degree angle, and I had a velocity of 1. Then because my angle is straight up, my increase would be 1y and 0x.

Not sure if this makes sense, I am programming a small game, that shoots on any angle, and I need to pass it x and y coordinates so it shoots on the same angle.

Thanks!

Just need the equation, or a tutorial

1 Answers 1

0

From $(0,0)$ at angle $\theta$ at velocity $1$ you get to $x=\cos\theta$, $y=\sin\theta$. You know trigonometry?

  • 0
    When I wrote "yes" above, it was to the $x=\cos45^\circ$, $y=\sin45^\circ$, not to the $x=0.707$, $y=1$ (which I didn't see at the time, perhaps it wasn't there at the time).2011-06-27