void dvhat_c ( ConstSpiceDouble s1 [6],
SpiceDouble sout[6] )
Find the unit vector corresponding to a state vector and the
derivative of the unit vector.
None.
VECTOR
DERIVATIVE
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
s1 I State to be normalized.
sout O Unit vector s1 / |s1|, and its time derivative.
s1 This is any double precision state. If the position
component of the state is the zero vector, this routine
will detect it and will not attempt to divide by zero.
sout sout is a state containing the unit vector pointing in
the direction of position component of s1 and the
derivative of the unit vector with respect to time.
sout may overwrite s1.
None.
Error free.
1) If s1 represents the zero vector, then the position
component of sout will also be the zero vector. The
velocity component will be the velocity component
of s1.
None.
Let s1 be a state vector with position and velocity components p
and v respectively. From these components one can compute the
unit vector parallel to p, call it u and the derivative of u
with respect to time, du. This pair (u,du) is the state returned
by this routine in sout.
Suppose that STATE gives the apparent state of a body with
respect to an observer. This routine can be used to compute the
instantaneous angular rate of the object across the sky as seen
from the observers vantage.
dvhat_c ( state, ustate );
vel[0] = ustate[3];
vel[1] = ustate[4];
vel[2] = ustate[5];
angular_rate = vnorm_c ( vel );
None.
None.
W.L. Taber (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.0.0, 7-JUL-1999
State of a unit vector parallel to a state vector
Link to routine dvhat_c source file dvhat_c.c
|