Table of contents
CSPICE_EUL2M constructs a 3x3, double precision matrix from
a set of Euler angles and the corresponding rotation axes.
Given:
angle3,
angle2,
angle1,
axis3,
axis2,
axis1 respectively, a set of three angles and three coordinate axis
numbers; each pair angleX and axisX specifies a coordinate
transformation consisting of a rotation by angleX radians about
the coordinate axis indexed by axisX.
help, angle3
DOUBLE = Scalar
help, angle2
DOUBLE = Scalar
help, angle1
DOUBLE = Scalar
help, axis3
LONG = Scalar
help, axis2
LONG = Scalar
help, axis1
LONG = Scalar
These coordinate transformations are typically symbolized by
[ angleX ] .
axisX
See the -Particulars section below for details concerning
this notation.
Note that these coordinate transformations rotate vectors
by
-angleX
radians about the axis indexed by axisX.
The values of axisX may be 1, 2, or 3, indicating the X,
Y, and Z axes respectively.
the call:
cspice_eul2m, angle3, angle2, angle1, axis3, axis2, axis1, r
returns:
r a rotation matrix representing the composition of the rotations
defined by the input angle-axis pairs.
help, r
DOUBLE = Array[3,3]
Together, the three pairs specify a composite transformation
that is the result of performing the rotations about the axes
indexed by `axis1', `axis2', and `axis3', in that order. So,
r = [ angle3 ] [ angle2 ] [ angle1 ]
axis3 axis2 axis1
See the -Particulars section below for details concerning
this notation.
The resulting matrix `r' may be thought of as a coordinate
transformation; applying it to a vector yields the
vector's coordinates in the rotated system.
Viewing `r' as a coordinate transformation matrix, the
basis that `r' transforms vectors to is created by rotating
the original coordinate axes first by `angle1' radians
about the coordinate axis indexed by `axis1', next by
`angle2' radians about the coordinate axis indexed by
`axis2', and finally by `angle3' radians about coordinate
axis indexed by `axis3'. At the second and third steps of
this process, the coordinate axes about which rotations
are performed belong to the bases resulting from the
previous rotations.
None.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
1) Create a rotation matrix for a single coordinate rotation of
90 degrees about the Z axis, and compute the vector resulting
from applying that rotation to the +X unit vector.
Example code begins here.
PRO eul2m_ex1
;;
;; Create the rotation matrix for a single coordinate
;; rotation of 90 degrees about the Z axis. As the
;; second and third angles are 0, the final two axes IDs,
;; 1, 1, have no effect for in this example.
;;
cspice_eul2m, cspice_halfpi(), 0.d, 0.d, 3, 1, 1, rot
;;
;; Output the result of rotating the +x unit vector
;; using the rot matrix. As 'rot' is a CSPICE matrix,
;; use the ## operator.
;;
print, FORMAT='(3F9.3)', rot ## [1.d, 0.d, 0.d ]
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
0.000 -1.000 0.000
A word about notation: the symbol
[ x ]
i
indicates a rotation of x radians about the ith coordinate axis.
To be specific, the symbol
[ x ]
1
indicates a coordinate system rotation of x radians about the
first, or x-, axis; the corresponding matrix is
.- -.
| 1 0 0 |
| |
| 0 cos(x) sin(x) |
| |
| 0 -sin(x) cos(x) |
`- -'
Remember, this is a COORDINATE SYSTEM rotation by x radians; this
matrix, when applied to a vector, rotates the vector by -x
radians, not x radians. Applying the matrix to a vector yields
the vector's representation relative to the rotated coordinate
system.
The analogous rotation about the second, or y-, axis is
represented by
[ x ]
2
which symbolizes the matrix
.- -.
| cos(x) 0 -sin(x) |
| |
| 0 1 0 |
| |
| sin(x) 0 cos(x) |
`- -'
and the analogous rotation about the third, or z-, axis is
represented by
[ x ]
3
which symbolizes the matrix
.- -.
| cos(x) sin(x) 0 |
| |
| -sin(x) cos(x) 0 |
| |
| 0 0 1 |
`- -'
From time to time, (depending on one's line of work, perhaps) one
may happen upon a pair of coordinate systems related by a
sequence of rotations. For example, the coordinate system
defined by an instrument such as a camera is sometime specified
by RA, DEC, and twist; if alpha, delta, and phi are the rotation
angles, then the series of rotations
[ phi ] [ pi/2 - delta ] [ alpha ]
3 2 3
produces a transformation from inertial to camera coordinates.
This routine is related to the Icy routine cspice_m2eul, which
produces a sequence of Euler angles, given a rotation matrix.
This routine is a "right inverse" of cspice_eul2m: the sequence of
calls
cspice_m2eul, r, axis3, axis2, axis1, angle3, angle2, angle1
cspice_eul2m, angle3, angle2, angle1, axis3, axis2, axis1, r
preserves `r' to round-off error.
On the other hand, the sequence of calls
cspice_eul2m, angle3, angle2, angle1, axis3, axis2, axis1, r
cspice_m2eul, r, axis3, axis2, axis1, angle3, angle2, angle1
preserve `angle3', `angle2', and `angle1' only if these angles start
out in the ranges that cspice_m2eul's outputs are restricted to.
1) If any of `axis3', `axis2', or `axis1' do not have values in
{ 1, 2, 3 }
the error SPICE(BADAXISNUMBERS) is signaled by a routine in
the call tree of this routine.
2) If any of the input arguments, `angle3', `angle2', `angle1',
`axis3', `axis2' or `axis1', is undefined, an error is
signaled by the IDL error handling system.
3) If any of the input arguments, `angle3', `angle2', `angle1',
`axis3', `axis2' or `axis1', is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
4) If the output argument `r' is not a named variable, an error
is signaled by the Icy interface.
None.
1) Beware: more than one definition of "RA, DEC and twist"
exists.
ICY.REQ
ROTATION.REQ
[1] W. Owen, "Galileo Attitude and Camera Models," JPL
Interoffice Memorandum 314-323, Nov. 11, 1983. NAIF document
number 204.0.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 31-MAY-2021 (JDR)
Edited the header to comply with NAIF standard. Extended arguments
description in -I/O section.
Added example's problem statement and reformatted example's output.
Added -Parameters, -Particulars, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added arguments' type and size information in the -I/O section.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
euler angles to matrix
|