SpiceDouble dvdot_c ( ConstSpiceDouble s1[6],
ConstSpiceDouble s2[6] )
Compute the derivative of the dot product of two double
precision position vectors.
None.
VECTOR
DERIVATIVE
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
s1 I First state vector in the dot product.
s2 I Second state vector in the dot product.
The function returns the derivative of the dot product <s1,s2>
s1 Any state vector. The components are in order
(x, y, z, dx/dt, dy/dt, dz/dt )
s2 Any state vector.
The function returns the derivative of the dot product of the
position portions of the two state vectors s1 and s2.
None.
Error free.
None.
Given two state vectors s1 and s2 made up of position and
velocity components (p1,v1) and (p2,v2) respectively,
dvdot_c calculates the derivative of the dot product of p1 and p2,
i.e. the time derivative
d
-- < p1, p2 > = < v1, p2 > + < p1, v2 >
dt
where <,> denotes the dot product operation.
Suppose that given two state vectors (s1 and s2)whose position
components are unit vectors, and that we need to compute the
rate of change of the angle between the two vectors.
We know that the Cosine of the angle (theta) between the vectors is
given by
cosine(theta) = vdot_c(s1,s2)
Thus by the chain rule, the derivative of the angle is given
by:
sine(theta) dtheta/dt = dvdot_c(s1,s2)
Thus for values of theta away from zero we can compute
dtheta/dt as
dtheta = dvdot_c(s1,s2) / sqrt ( 1 - vdot_c(s1,s2)**2 )
Note if the position components of s1 and s2 are parallel, the
derivative of the angle between the positions does not
exist. Any code that computes the derivative of the angle
between two position vectors should account for the case
when the position components are parallel.
The user is responsible for determining that the states s1 and
s2 are not so large as to cause numeric overflow. In most cases
this won't present a problem.
None.
W.L. Taber (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.0.0, 7-JUL-1999
Compute the derivative of a dot product
Link to routine dvdot_c source file dvdot_c.c
|