vrotv_c |
Table of contents
Procedurevrotv_c ( Vector rotation about an axis ) void vrotv_c ( ConstSpiceDouble v [3], ConstSpiceDouble axis [3], SpiceDouble theta, SpiceDouble r [3] ) AbstractRotate a vector about a specified axis vector by a specified angle and return the rotated vector. Required_ReadingROTATION KeywordsROTATION VECTOR Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- v I Vector to be rotated. axis I Axis of the rotation. theta I Angle of rotation (radians). r O Result of rotating `v' about axis by `theta'. Detailed_Inputv is a 3-dimensional vector to be rotated. axis is the axis about which the rotation is to be performed. theta is the angle through which `v' is to be rotated about axis. Detailed_Outputr is the result of rotating `v' about `axis' by `theta'. If `axis' is the zero vector, r = v. ParametersNone. ExceptionsError free. 1) If the input axis is the zero vector, `r' will be returned as `v'. FilesNone. ParticularsThis routine computes the result of rotating (in a right handed sense) the vector v about the axis represented by axis through an angle of theta radians. If w is a unit vector parallel to axis, then r is given by: r = v + ( 1 - cos(theta) ) (w X(w X v)) + sin(theta) (w X v) where "X" above denotes the vector cross product. ExamplesIf axis = ( 0, 0, 1 ) and theta = pi/2 then the following results for r will be obtained v r ------------- ---------------- ( 1, 2, 3 ) ( -2, 1, 3 ) ( 1, 0, 0 ) ( 0, 1, 0 ) ( 0, 1, 0 ) ( -1, 0, 0 ) If axis = ( 0, 1, 0 ) and theta = pi/2 then the following results for r will be obtained v r ------------- ---------------- ( 1, 2, 3 ) ( 3, 2, -1 ) ( 1, 0, 0 ) ( 0, 0, -1 ) ( 0, 1, 0 ) ( 0, 1, 0 ) If axis = ( 1, 1, 1 ) and theta = pi/2 then the following results for r will be obtained v r ----------------------------- ----------------------------- ( 1.0, 2.0, 3.0 ) ( 2.577.., 0.845.., 2.577.. ) ( 2.577.., 0.845.., 2.577.. ) ( 3.0 2.0, 1.0 ) ( 3.0 2.0, 1.0 ) ( 1.422.., 3.154.., 1.422.. ) ( 1.422.., 3.154.., 1.422.. ) ( 1.0 2.0, 3.0 ) RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) H.A. Neilan (JPL) W.L. Taber (JPL) Version-CSPICE Version 1.0.2, 05-JUL-2021 (JDR) Edited the header to comply with NAIF standard. -CSPICE Version 1.0.1, 05-FEB-2003 (NJB) Header examples were corrected. -Exceptions section filled in. Miscellaneous header corrections were made. -CSPICE Version 1.0.0, 22-OCT-1998 (NJB) (HAN) (WLT) Index_Entriesvector rotation about an axis |
Fri Dec 31 18:41:15 2021