Angle Between Two Vectors

From Second Life Wiki
Revision as of 12:56, 24 January 2015 by ObviousAltIsObvious Resident (talk | contribs) (<lsl> tag to <source>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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.

angle = llAtan2( llVecMag(A % B), A * B )
angle = llAcos( A * B )

See llAngleBetween for angle between rotations.