The Elk Code
 
Loading...
Searching...
No Matches
eulerrot.f90
Go to the documentation of this file.
1
2! Copyright (C) 2014 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: eulerrot
8! !INTERFACE:
9pure subroutine eulerrot(ang,rot)
10! !INPUT/OUTPUT PARAMETERS:
11! ang : Euler angles (alpha, beta, gamma) (in,real(3))
12! rot : rotation matrix (out,real(3,3))
13! !DESCRIPTION:
14! Given a set of Euler angles, $(\alpha,\beta,\gamma)$, this routine
15! determines the corresponding $3\times 3$ rotation matrix. The so-called
16! `y-convention' is taken for the Euler angles. See the routine {\tt roteuler}
17! for details.
18!
19! !REVISION HISTORY:
20! Created January 2014 (JKD)
21!EOP
22!BOC
23implicit none
24! arguments
25real(8), intent(in) :: ang(3)
26real(8), intent(out) :: rot(3,3)
27! local variables
28real(8) sa,sb,sg,ca,cb,cg
29sa=sin(ang(1)); ca=cos(ang(1))
30sb=sin(ang(2)); cb=cos(ang(2))
31sg=sin(ang(3)); cg=cos(ang(3))
32rot(1,1)=cg*cb*ca-sg*sa
33rot(2,1)=-sg*cb*ca-cg*sa
34rot(3,1)=sb*ca
35rot(1,2)=cg*cb*sa+sg*ca
36rot(2,2)=-sg*cb*sa+cg*ca
37rot(3,2)=sb*sa
38rot(1,3)=-cg*sb
39rot(2,3)=sg*sb
40rot(3,3)=cb
41end subroutine
42!EOC
43
pure subroutine eulerrot(ang, rot)
Definition eulerrot.f90:10