Difference between revisions of "LlVecMag"

From Second Life Wiki
Jump to: navigation, search
m (LSL llVecMag moved to LlVecMag: removing prefix)
Line 1: Line 1:
 
{{LSL_Function
 
{{LSL_Function
 
|func=llVecMag
 
|func=llVecMag
|func_id=12
+
|func_id=12|func_sleep=0.0|func_energy=10.0
|func_sleep=0.0
+
|func_energy=10.0
+
 
|func_footnote
 
|func_footnote
|p1_type=vector
+
|p1_type=vector|p1_name=vec|p1_desc
|p1_name=vec
+
|p1_desc
+
|p2_type|p2_name|p2_desc
+
|p3_type|p3_name|p3_desc
+
|p4_type|p4_name|p4_desc
+
|p5_type|p5_name|p5_desc
+
|p6_type|p6_name|p6_desc
+
|p7_type|p7_name|p7_desc
+
|p8_type|p8_name|p8_desc
+
|p9_type|p9_name|p9_desc
+
|p10_type|p10_name|p10_desc
+
|p11_type|p11_name|p11_desc
+
|p12_type|p12_name|p12_desc
+
 
|return_type=float
 
|return_type=float
 
|return_text=that is the magnitude of the vector (the distance from '''vec''' to <0.0, 0.0, 0.0>).
 
|return_text=that is the magnitude of the vector (the distance from '''vec''' to <0.0, 0.0, 0.0>).
 
|spec
 
|spec
 
|caveats
 
|caveats
|examples=
+
|examples=<pre>
<lsl>
+
 
default {
 
default {
 
     state_entry()
 
     state_entry()
Line 32: Line 16:
 
     }
 
     }
 
}
 
}
</lsl>
+
</pre>
 
|helpers
 
|helpers
|also_functions=*{{LSLG|llVecNorm}}
+
|also_functions=
*{{LSLG|llVecDist}}
+
{{LSL DefineRow||[[llVecNorm]]|The vector normal}}
 +
{{LSL DefineRow||[[llVecDist]]|The distance between two vectors}}
 
|also_events
 
|also_events
 
|also_tests
 
|also_tests
Line 45: Line 30:
 
|cat2
 
|cat2
 
|cat3
 
|cat3
|cat4=Stub
+
|cat4
 
}}
 
}}

Revision as of 20:15, 22 February 2007

Summary

Function: float llVecMag( vector vec );

Returns a float that is the magnitude of the vector (the distance from vec to <0.0, 0.0, 0.0>).

• vector vec

Examples

default {
    state_entry()
    {
        vector input = <1.0,2.0,3.0>;
        llSay(0,"The magnitude of "+(string)input+" is: "+(string)llVecMag(input) );
    }
}

See Also

Functions

•  llVecNorm The vector normal
•  llVecDist The distance between two vectors

Deep Notes

Search JIRA for related Issues

Signature

function float llVecMag( vector vec );