The unit matrix is defined in the following way:
| ||
| ||
|
| |||||
| |||||
|
This is just an example. There is in fact no need to define a unit rotation matrix. Giving the value 0 to the rotation matrix number in the call to GSPOS and GSPOSP is equivalent to a positioning without rotation and it improves tracking performance.
The result of a counterclockwise rotation around z, followed by a counterclockwise rotation around the new x is a cyclic shift of the axes: . This is expressed by the following rotation matrix:
| ||
| ||
|
| |||||
| |||||
|
Sometimes the rotation matrix is known or it can be constructed. In this case the arguments to the routine GSROTM can be calculated with the help of the routine GFANG in the following way:
DIMENSION ROTMAT(3,3), ROWMAT(3), PHI(3), THETA(3) LOGICAL ROTATE . . . DO 10 I=1,3 ROWMAT(1) = ROTMAT(I,1) ROWMAT(2) = ROTMAT(I,2) ROWMAT(3) = ROTMAT(I,3) CALL GFANG(ROWMAT,COSTH,SINTH,COSPH,SINPH,ROTATE) THETA(I) = ATAN2(SINTH,COSTH) PHI(I) = ATAN2(SINPH,COSPH) 10 CONTINUE . . {\sl Transform to degrees} . CALL GSROTM(IROT,THETA(1),PHI(1),THETA(2),PHI(2),THETA(3),PHI(3))
CALL GPROTM (IROT) Prints the rotation matrix elements and angles.