MAL.UnitVector |
![]() ![]() |
ref_arr_out = MAL.UnitVector( [BYREF arr_out AS ARRAY], BYREF arr_in AS ARRAY, [BYVAL nPoint AS INTEGER=ML_ALL], [BYVAL nFrameOffset AS INTEGER=0] ) AS REFERENCE
Normalizes a 2D/3D vector and creates an output Unit Vector of the same dimensions. A Unit Vector in a normed vector space is a vector of length 1.
Example:
DIM arrVLen(nFrames,nPoints,1) AS REAL
' Calculate Vector Length or Point 2 and 3 MAL.VectorLength( arrVLen, arrPoints, PTS( 2, 3 ) ) CALL PrintArray( REF( arrVLen ) )
' Calculate the Vector Length of the Unit Vector MAL.VectorLength( arrVLen, MAL.UnitVector( arrPoints, arrPoints, PTS( 4, 5 ) ), PTS( 4, 5 ) ) CALL PrintArray( REF( arrVLen ) )
|