Angle Between Two Vectors

From Second Life Wiki
Revision as of 00:17, 22 October 2010 by Qu Qi (Talk | contribs)

Jump to: navigation, search

Two methods for finding the angle between two vectors. The advantage of the first is that the vectors need not be normalized. If you know you have normal vectors then you can use the second method.

<lsl>angle = llAtan2( llVecMag(A % B), A * B )</lsl> <lsl>angle = llAcos( A * B )</lsl>

See llAngleBetween for angle between rotations.