void vhat_c ( ConstSpiceDouble v1 [3],
SpiceDouble vout[3] )
Find the unit vector along a double precision 3-dimensional vector.
None.
VECTOR
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I Vector to be unitized.
vout O Unit vector v1 / |v1|.
v1 This is any double precision, 3-dimensional vector.
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.
None.
Error free.
If v1 represents the zero vector, then vout will also be the zero
vector.
None.
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.
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 )
None.
There is no known case whereby floating point overflow may occur.
Thus, no error recovery or reporting scheme is incorporated
into this subroutine.
None.
N.J. Bachman (JPL)
W.L. Taber (JPL)
W.M. Owen (JPL)
-CSPICE Version 1.0.2, 16-JAN-2008 (EDW)
Corrected typos in header titles:
Detailed Input to Detailed_Input
Detailed Output to Detailed_Output
-CSPICE Version 1.0.1, 12-NOV-2006 (EDW)
Added Parameters section header.
-CSPICE Version 1.0.0, 16-APR-1999 (EDW)
unitize a 3-dimensional vector
Link to routine vhat_c source file vhat_c.c
|