SpiceDouble vdot_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3] )
Compute the dot product of two double precision, 3-dimensional
vectors.
None.
VECTOR
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I First vector in the dot product.
v2 I Second vector in the dot product.
The function returns the value of the dot product of v1 and v2.
v1 This may be any 3-dimensional, double precision vector.
v2 This may be any 3-dimensional, double precision vector.
The function returns the value of the dot product of v1 and v2.
None.
Error free.
None.
vdot_c calculates the dot product of v1 and v2 by a simple
application of the definition. No error checking is performed to
prevent numeric overflow.
Suppose that given two position vectors, we want to change
one of the positions until the two vectors are perpendicular.
The following code fragment demonstrates the use of vdot_c to do so.
dot = vdot_c ( v1, v2 )
while ( fabs(dot) > tolerance )
{
[ CHANGE ONE OF THE POSITION VECTORS ]
dot = vdot_c ( v1, v2 )
}
The user is responsible for determining that the vectors v1 and
v2 are not so large as to cause numeric overflow. In most cases
this won't present a problem.
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)
dot product 3-dimensional vectors
Link to routine vdot_c source file vdot_c.c
|