/
getLength
getLength
Description
Use getLength when you need to obtain the length of a vector.
Given the position of an object in a variable of type vector, getLength returns the distance from that object to the origin.
Use getDistance when you need to obtain the distance between two points specified as variables of type vector.
Functional area
Math
Command syntax
Syntax
getLength vector |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
vector | vector | yes | Vector variable |
Flags
None
Return value
float
Returns a floating point value which is the length of the input vector v
Examples
// In this procedure, a vector variable is declared and getLength is // used to return its length. // The command returns a float value of: 5 (3-4-5 right triangle) vector $v1 = <<3, 4, 0>>; float $length = getLength($v1); print( $length );
Additional information
Related commands
, multiple selections available,