void vrotv_c ( ConstSpiceDouble v [3],
ConstSpiceDouble axis [3],
SpiceDouble theta,
SpiceDouble r [3] )
Rotate a vector about a specified axis vector by a specified
angle and return the rotated vector.
ROTATION
ROTATION, VECTOR
VARIABLE 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.
v 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.
r is the result of rotating v about axis by theta.
If axis is the zero vector, r = v.
None.
Error free.
1) If the input axis is the zero vector r will be returned
as v.
None.
This 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.
If 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 )
None.
None.
N.J. Bachman (JPL)
H.A. Neilan (JPL)
W.L. Taber (JPL)
-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)
vector rotation about an axis
Link to routine vrotv_c source file vrotv_c.c
|