- Abstract
Find the unit vector along a double precision 3-dimensional vector.
- Required_Reading
None.
- Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I Vector to be unitized.
vout O Unit vector v1 / |v1|.
- Detailed_Input
v1 This is any double precision, 3-dimensional vector.
- Detailed_Output
vout vout contains the unit vector in the direction of v1.
If v1 represents the zero vector, then vout will also
be the zero vector. vout may overwrite v1.
- Particulars
vhat_c determines the magnitude of v1 and then divides each
component of v1 by the magnitude. This process is highly stable
over the whole range of 3-dimensional vectors.
- Examples
The following table shows how v1 maps to vout.
v1 vout
------------------ ------------------
( 5, 12, 0 ) ( 5/13, 12/13, 0 )
( 1.e-7, 2.e-7, 2.e-7 ) ( 1/3, 2/3, 2/3 )
- Restrictions
None.
There is no known case whereby floating point overflow may occur.
Thus, no error recovery or reporting scheme is incorporated
into this subroutine.
- Exceptions
Error free.
If v1 represents the zero vector, then vout will also be the zero
vector.
- Files
None.
- Author_and_Institution
N.J. Bachman (JPL)
W.L. Taber (JPL)
W.M. Owen (JPL)
- Literature_References
None.
- Version
-CSPICE Version 1.0.0, 16-APR-1999 (EDW)
- Index_Entries
unitize a 3-dimensional vector
- Link to routine source