Difference between revisions of "Angle Between Two Vectors"

From Second Life Wiki
Jump to navigation Jump to search
Line 4: Line 4:
<lsl>angle = llAcos( A * B )</lsl>
<lsl>angle = llAcos( A * B )</lsl>


What's the difference between this and [[llAngleBetween]]?
See [[llAngleBetween]] for angle between rotations.


{{LSLC|Examples|Angle Between Two Vectors}}
{{LSLC|Examples|Angle Between Two Vectors}}

Revision as of 23:17, 21 October 2010

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.