Difference between revisions of "LlAngleBetween"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{Issue/SVC-2424}}{{LSL_Function
{{Issues/SVC-2424}}{{LSL_Function
|func_id=174|func_sleep=0.0|func_energy=10.0
|func_id=174|func_sleep=0.0|func_energy=10.0
|func=llAngleBetween|sort=AngleBetween
|func=llAngleBetween|sort=AngleBetween

Revision as of 01:49, 21 June 2009

Summary

Function: float llAngleBetween( rotation a, rotation b );
0.0 Forced Delay
10.0 Energy

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

• rotation a start rotation
• rotation b end rotation

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>

Signature

function float llAngleBetween( rotation a, rotation b );