VectorUnitize

Unitizes, or normalizes, a 3-D vector. A vector is called a unit vector when its length or magnitude is equal to one unit. Note, zero vectors cannot be unitized.

Syntax

Rhino.VectorUnitize (arrVector)

Parameters

arrVector

Required.  Array.  The 3-D vector to unitize.

Returns

Array

The resulting 3-D vector if successful.

Null

On error.

Example

Dim arrVector

arrVector = Rhino.VectorUnitize(Array(1.5,-4.1,3.6))

Rhino.Print Rhino.Pt2Str(arrVector)

Also See

IsVectorZero

VectorCreate