Scilab Function
Last update : April 2007
rt_unit  unitize a vector[view code]
Calling Sequence
 vn = rt_unit(v)
Parameters

v
: pelement vector (p is arbitrary). A generic pdimensional vector.

vn
: pelement vector. The unit vector aligned with v.
Description

Return a unit vector aligned with v.
Examples
// A generic vector in 3D space
v = [2, 4, 5],
norm(v), // v is a nonunit vector
// unit vector aligned with v
vn = rt_unit(v), // vn is a unit vector
norm(vn),
See Also
norm,
Authors
original Matlab version by

Peter I. Corke
CSIRO Manufacturing Science and Technology
Scilab implementation by

Matteo Morelli
Interdepartmental Research Center "E. Piaggio", University of Pisa
Bibliography
Corke, P.I. "A Robotics Toolbox for MATLAB", IEEE Robotics and Automation Magazine, Volume 3(1), March 1996, pp. 2432