vcrss_c |

Table of contents## Procedurevcrss_c ( Vector cross product, 3 dimensions ) void vcrss_c ( ConstSpiceDouble v1[3], ConstSpiceDouble v2[3], SpiceDouble vout[3] ) ## AbstractCompute the cross product of two 3-dimensional vectors. ## Required_ReadingNone. ## KeywordsVECTOR ## Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- v1 I Left hand vector for cross product. v2 I Right hand vector for cross product. vout O Cross product v1 x v2. ## Detailed_Inputv1, v2 are two 3-dimensional vectors. Typically, these might represent the (possibly unit) vector to a planet, Sun, or a star which defines the orientation of axes of some reference frame. ## Detailed_Outputvout is the cross product of `v1' and `v2'. `vout' may overwrite `v1' or `v2'. ## ParametersNone. ## ExceptionsError free. ## FilesNone. ## Particulars
## ExamplesThe numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Define two sets of vectors and compute the cross product of each vector in first set and the corresponding vector in the second set. Example code begins here. /. Program vcrss_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { /. Local parameters. ./ #define NDIM 3 #define SETSIZ 2 /. Local variables. ./ SpiceDouble vout [NDIM]; SpiceInt i; /. Define the two vector sets. ./ SpiceDouble seta [SETSIZ][NDIM] = { {0.0, 1.0, 0.0}, {5.0, 5.0, 5.0} }; SpiceDouble setb [SETSIZ][NDIM] = { { 1.0, 0.0, 0.0}, {-1.0, -1.0, -1.0} }; /. Calculate the cross product of each pair of vectors ./ for ( i = 0; i < SETSIZ; i++ ) { ## Restrictions1) No checking of `v1' or `v2' is done to prevent floating point overflow. The user is required to determine that the magnitude of each component of the vectors is within an appropriate range so as not to cause floating point overflow. In almost every case there will be no problem and no checking actually needs to be done. ## Literature_ReferencesNone. ## Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) W.M. Owen (JPL) E.D. Wright (JPL) ## Version-CSPICE Version 1.1.1, 05-JUL-2021 (JDR) Edited the header to comply with NAIF standard. Added complete code example based on existing example. -CSPICE Version 1.1.0, 22-OCT-1998 (NJB) Made input vectors const. -CSPICE Version 1.0.1, 06-MAR-1998 (EDW) Minor header correction. Added use of MOVED. -CSPICE Version 1.0.0, 08-FEB-1998 (EDW) (WMO) ## Index_Entriesvector cross product |

Fri Dec 31 18:41:14 2021