unit

 
 
 

Returns the unit vector corresponding to a vector.

The unit vector has the same direction as the specified vector, but with a magnitude of 1.

vector unit( vector vector)

vector is the vector whose unit vector you want.

Example

unit(<<1,1,1>>)

Returns <<0.577, 0.577, 0.577>>.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License