m2eul_c |

## Procedurevoid m2eul_c ( ConstSpiceDouble r[3][3], SpiceInt axis3, SpiceInt axis2, SpiceInt axis1, SpiceDouble * angle3, SpiceDouble * angle2, SpiceDouble * angle1 ) ## AbstractFactor a rotation matrix as a product of three rotations about specified coordinate axes. ## Required_ReadingROTATION ## KeywordsANGLE MATRIX ROTATION TRANSFORMATION ## Brief_I/OVariable I/O Description -------- --- -------------------------------------------------- r I A rotation matrix to be factored. axis3, axis2, axis1 I Numbers of third, second, and first rotation axes. angle3, angle2, angle1 O Third, second, and first Euler angles, in radians. ## Detailed_Inputr is a 3x3 rotation matrix that is to be factored as a product of three rotations about a specified coordinate axes. The angles of these rotations are called `Euler angles'. axis3, axis2, axis1 are the indices of the rotation axes of the `factor' rotations, whose product is r. r is factored as r = [ angle3 ] [ angle2 ] [ angle1 ] . axis3 axis2 axis1 The axis numbers must belong to the set {1, 2, 3}. The second axis number MUST differ from the first and third axis numbers. See the Particulars section below for details concerning this notation. ## Detailed_Outputangle3, angle2, angle1 are the Euler angles corresponding to the matrix r and the axes specified by axis3, axis2, and axis1. These angles satisfy the equality r = [ angle3 ] [ angle2 ] [ angle1 ] axis3 axis2 axis1 See the Particulars section below for details concerning this notation. The range of angle3 and angle1 is (-pi, pi]. The range of angle2 depends on the exact set of axes used for the factorization. For factorizations in which the first and third axes are the same, r = [R] [S] [T] , a b a the range of angle2 is [0, pi]. For factorizations in which the first and third axes are different, r = [R] [S] [T] , a b c the range of angle2 is [-pi/2, pi/2]. For rotations such that angle3 and angle1 are not uniquely determined, angle3 will always be set to zero; angle1 is then uniquely determined. ## ParametersNone. ## Exceptions1) If any of axis3, axis2, or axis1 do not have values in { 1, 2, 3 }, then the error SPICE(INPUTOUTOFRANGE) is signalled. 2) An arbitrary rotation matrix cannot be expressed using a sequence of Euler angles unless the second rotation axis differs from the other two. If axis2 is equal to axis3 or axis1, then then error SPICE(BADAXISNUMBERS) is signalled. 3) If the input matrix r is not a rotation matrix, the error SPICE(NOTAROTATION) is signalled. 4) If angle3 and angle1 are not uniquely determined, angle3 is set to zero, and angle1 is determined. ## FilesNone. ## ParticularsA word about notation: the symbol [ x ] i indicates a coordinate system 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 | +- -+ The input matrix is assumed to be the product of three rotation matrices, each one of the form +- -+ | 1 0 0 | | | | 0 cos(r) sin(r) | (rotation of r radians about the | | x-axis), | 0 -sin(r) cos(r) | +- -+ +- -+ | cos(s) 0 -sin(s) | | | | 0 1 0 | (rotation of s radians about the | | y-axis), | sin(s) 0 cos(s) | +- -+ or +- -+ | cos(t) sin(t) 0 | | | | -sin(t) cos(t) 0 | (rotation of t radians about the | | z-axis), | 0 0 1 | +- -+ where the second rotation axis is not equal to the first or third. Any rotation matrix can be factored as a sequence of three such rotations, provided that this last criterion is met. This routine is related to the CSPICE routine EUL2M, which produces a rotation matrix, given a sequence of Euler angles. This routine is a `right inverse' of EUL2M: the sequence of calls ## Examples1) Conversion of instrument pointing from a matrix representation to Euler angles: Suppose we want to find camera pointing in alpha, delta, and kappa, given the inertial-to-camera coordinate transformation ticam = +- -+ | 0.49127379678135830 0.50872620321864170 0.70699908539882417 | | | | -0.50872620321864193 -0.49127379678135802 0.70699908539882428 | | | | 0.70699908539882406 -0.70699908539882439 0.01745240643728360 | +- -+ We want to find angles alpha, delta, kappa such that ticam = [ kappa ] [ pi/2 - delta ] [ pi/2 + alpha ] . 3 1 3 The code fragment ## RestrictionsNone. ## Literature_ReferencesNone. ## Author_and_InstitutionN.J. Bachman (JPL) ## Version-CSPICE Version 1.3.1, 13-OCT-2004 (NJB) Fixed header typo. -CSPICE Version 1.3.0, 21-OCT-1998 (NJB) Made input matrix const. -CSPICE Version 1.2.0, 13-FEB-1998 (EDW) Minor corrections to header. -CSPICE Version 1.2.0, 08-FEB-1998 (NJB) Removed local variables used for temporary capture of outputs. -CSPICE Version 1.0.0 25-OCT-1997 (NJB) Based on SPICELIB Version 1.1.1, 10-MAR-1992 (WLT) ## Index_Entriesmatrix to euler angles |

Wed Apr 5 17:54:38 2017