Read this article which explains inverse trajectory determination.

If you want to rotate the projectile sprite in the direction it is traveling, then subtract your current position by your previous position. This will give you your linear velocity at that current point. With this you can calculate the direction of the projectile.

Direction in radians:

dirInRad = atan2(linearVelocity.y, linearVelocity.x);

Convert this value into degrees:

dirInDeg = 180 / pi * dirInRad;

Hope this is the answer you were looking for.

I would also suggest using a physics library if you don’t have the time to learn the technical stuff. You can google physics library followed by your language of choice.

Hi to all,

I tried to do cannon projectiles for a game.I know the destination point where the cannon should land and also have a option of selecting the speed it travels say from 80 Kph to 100 Kph.I need to know the angle.How can i find the angle (theta) for the projectile .MY Launching position is higher than the landing position.Please help me fix this.Thanks in Advance

—Rajesh—