Angle Between Two Vectors: Difference between revisions
Jump to navigation
Jump to search
m Replaced <source> with <syntaxhighlight> |
m Added Template:LSL Header |
||
Line 1: | Line 1: | ||
{{LSL Header}} | |||
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. | 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. | ||
Latest revision as of 18:01, 28 January 2025
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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.
<syntaxhighlight lang="lsl2">angle = llAtan2( llVecMag(A % B), A * B )</syntaxhighlight> <syntaxhighlight lang="lsl2">angle = llAcos( A * B )</syntaxhighlight>
See llAngleBetween for angle between rotations.