void vsub_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3],
SpiceDouble vout[3] )
Compute the difference between two 3-dimensional, double
precision vectors.
None.
VECTOR
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I First vector (minuend).
v2 I Second vector (subtrahend).
vout O Difference vector, v1 - v2. vout can overwrite
either v1 or v2.
v1 This can be any 3-dimensional, double precision vector.
v2 Ditto.
vout This is a 3-dimensional, double precision vector which
represents the vector difference, v1 - v2.
None.
Error free.
None.
This routine simply performs subtraction between components of v1
and v2. No checking is performed to determine whether floating
point overflow has occurred.
The following table shows the output vout as a function of the
the input v1 and v2 from the subroutine vsub_c.
v1 v2 ---> vout
-------------- -------------- --------------
[1.0 , 2.0, 3.0] [4.0 , 5.0 , 6.0] [-3.0 , -3.0, -3.0]
[1e-7,1e23, 0.0] [1e24, 1e23, 0.0] [-1e24, 0.0, 0.0]
The user is required to determine that the magnitude each
component of the vectors is within the appropriate range so as
not to cause floating point overflow. No error recovery or
reporting scheme is incorporated in this subroutine.
None.
W.M. Owen (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.1.1, 07-NOV-2003 (EDW)
Corrected a mistake in the second example's value
for VOUT, i.e. replaced [1D24, 2D23, 0.0] with
[-1e24, 0.0, 0.0].
-CSPICE Version 1.1.0, 22-OCT-1998 (NJB)
Made input vectors const.
-CSPICE Version 1.0.0, 08-FEB-1998 (EDW)
3-dimensional vector subtraction
Link to routine vsub_c source file vsub_c.c
|