aboutsummaryrefslogtreecommitdiff
path: root/src/slalib/euler.f
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-03-04 21:21:30 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-03-04 21:21:30 -0500
commitd54fe7c1f704a63824c5bfa0ece65245572e9b27 (patch)
treeafc52015ffc2c74e0266653eecef1c8ef8ba5d91 /src/slalib/euler.f
downloadcalfuse-d54fe7c1f704a63824c5bfa0ece65245572e9b27.tar.gz
Initial commit
Diffstat (limited to 'src/slalib/euler.f')
-rw-r--r--src/slalib/euler.f68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/slalib/euler.f b/src/slalib/euler.f
new file mode 100644
index 0000000..278da31
--- /dev/null
+++ b/src/slalib/euler.f
@@ -0,0 +1,68 @@
+ SUBROUTINE sla_EULER (ORDER, PHI, THETA, PSI, RMAT)
+*+
+* - - - - - -
+* E U L E R
+* - - - - - -
+*
+* Form a rotation matrix from the Euler angles - three successive
+* rotations about specified Cartesian axes (single precision)
+*
+* Given:
+* ORDER c*(*) specifies about which axes the rotations occur
+* PHI r 1st rotation (radians)
+* THETA r 2nd rotation ( " )
+* PSI r 3rd rotation ( " )
+*
+* Returned:
+* RMAT r(3,3) rotation matrix
+*
+* A rotation is positive when the reference frame rotates
+* anticlockwise as seen looking towards the origin from the
+* positive region of the specified axis.
+*
+* The characters of ORDER define which axes the three successive
+* rotations are about. A typical value is 'ZXZ', indicating that
+* RMAT is to become the direction cosine matrix corresponding to
+* rotations of the reference frame through PHI radians about the
+* old Z-axis, followed by THETA radians about the resulting X-axis,
+* then PSI radians about the resulting Z-axis.
+*
+* The axis names can be any of the following, in any order or
+* combination: X, Y, Z, uppercase or lowercase, 1, 2, 3. Normal
+* axis labelling/numbering conventions apply; the xyz (=123)
+* triad is right-handed. Thus, the 'ZXZ' example given above
+* could be written 'zxz' or '313' (or even 'ZxZ' or '3xZ'). ORDER
+* is terminated by length or by the first unrecognized character.
+*
+* Fewer than three rotations are acceptable, in which case the later
+* angle arguments are ignored. If all rotations are zero, the
+* identity matrix is produced.
+*
+* Called: sla_DEULER
+*
+* P.T.Wallace Starlink 23 May 1997
+*
+* Copyright (C) 1997 Rutherford Appleton Laboratory
+*-
+
+ IMPLICIT NONE
+
+ CHARACTER*(*) ORDER
+ REAL PHI,THETA,PSI,RMAT(3,3)
+
+ INTEGER J,I
+ DOUBLE PRECISION W(3,3)
+
+
+
+* Compute matrix in double precision
+ CALL sla_DEULER(ORDER,DBLE(PHI),DBLE(THETA),DBLE(PSI),W)
+
+* Copy the result
+ DO J=1,3
+ DO I=1,3
+ RMAT(I,J) = REAL(W(I,J))
+ END DO
+ END DO
+
+ END