llAngleBetween

From Second Life Wiki
Jump to navigation Jump to search

Summary

Function: float llAngleBetween( rotation a, rotation b );

Returns a float that is the angle between rotation a and b.

• rotation a start rotation
• rotation b end rotation

Caveats

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llAngleBetween() is sometimes inaccurate

Examples

See Also

Functions

•  llRotBetween
•  llRot2Angle Similar functionality used for the Axis-Angle format

Deep Notes

<lsl>float AngleBetween(rotation a, rotation b) {

   return 2.0 * llAcos((a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s)
              / llSqrt((a.x * a.x + a.y * a.y + a.z * a.z + a.s * a.s)
                     * (b.x * b.x + b.y * b.y + b.z * b.z + b.s * b.s)));

}</lsl>

All Issues

~ Search JIRA for related Issues
   llAngleBetween() is sometimes inaccurate

Signature

function float llAngleBetween( rotation a, rotation b );