llVecNorm
Revision as of 06:22, 23 May 2009 by Strife Onizuka (talk | contribs) (I forget what happens if you feed this function a zero vector, this edge case should be documented. We are talking about advanced mathematics, if they don't know normalized, they won't know unit too.)
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector llVecNorm( vector vec );13 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns the vector that is vec normalized (a unit vector sharing the same direction as vec).
• vector | vec | – | Any valid vector |
Functionally equivalent to: vec / llVecMag(vec))
Caveats
Examples
<lsl> default {
state_entry() { vector input = <1.0,2.0,3.0>; llSay(0,"The unit vector on "+(string)input+" is: "+(string)llVecNorm(input) ); }
}
</lsl>