Description
Returns the unit vector by dividing the given vector by its own magnitude.
This function has been Deprecated. Please use [Array].Normalized() instead.
Timing Precision Mode
This page describes functionality in millisecond timing precision mode.
Function Signature
UnitizeVector(
|
Array vector)
|
Arguments
vector
|
|
Description:
|
A three-element vector.
|
Required Size:
|
At least 3
|
Return Value
Type:
|
Array of number (size = 3)
|
Returns the unit vector by dividing the given vector by its own magnitude.
Syntax
myArray1 = UnitizeVector(myArray2);
|
The following example computes the unitized position vector of a Spacecraft.
Array UnitSCPos[3];
UnitSCPos = UnitizeVector(Spacecraft1.Position);
Report UnitSCPos;
|
Output:
UnitSCPos
|
{ -0.481160921 0.839531655 -0.252330673}
|
|
The following example computes the unitized version of the specified array.
Array UnitVec[3];
UnitVec = UnitizeVector({37.2, -10, 1});
Report UnitVec;
|
Output:
UnitVec
|
{ 0.965390700 -0.259513629 0.025951363}
|
|
See also
UnitizeVector
|