gltester

01-27-2004, 11:52 AM

In 2D you can view a point's X,Y coordinates as a vector and that vector can be thought of a describing a direction from the origin -- or a rotation around the origin.

To get the 2D angle of rotation you can do:

angle = tan(y/x);

Easy, but how do you do it with a 3D vector? I know in 3D you need three angles to represent any possible direction. Seems like there should be three simple trig equations for finding these angles when you have X,Y,Z but I can't seem to find the right Google phrase to search for today.

Please help!

To get the 2D angle of rotation you can do:

angle = tan(y/x);

Easy, but how do you do it with a 3D vector? I know in 3D you need three angles to represent any possible direction. Seems like there should be three simple trig equations for finding these angles when you have X,Y,Z but I can't seem to find the right Google phrase to search for today.

Please help!