# 3D tilt angle for an arrow in archery game

How can I calculate the angle of rotation/tilt of an arrow in 3D?

When I say angle I mean the angle the arrow takes when it flies through the projectile path.

I am using logic given in the below link to calculate the location in the 3D space

http://babek.info/libertybasicfiles/lbnews/nl130/proj3d.htm

and also OpenGL for rendering

-
possible duplicate of Projectile Motion - Arrow – bummzack Feb 3 '12 at 8:30

Simplistically the arrow will always lie tangent to the curve described by its trajectory. The tangent to any curve is simply the derivative or the slope of the curve at the point of the tangent.

To calculate this take the inverse tangent of (y1-y)/(x1-x) and repeat for the other planes to get the 3 required angles in 3D. (y1 and x1 are simply y and x values one time or distance step in advance of y and x)

-

Take a look at this answer, remeber that in this case the 2D and 3D are quite the same thing since your arrow trajectory (probably) lies on a plane.

-