TABLE OF CONTENTS
- 1. /rotation
- 1.1. rotation/rotateTo
- 1.2. rotation/rotateFrom
- 1.3. rotation/rotateYZ
- 1.4. rotation/rotateYZback
- 1.5. rotation/rotateZY
- 1.6. rotation/get_phi_theta
/rotation [ Modules ]
NAME
module rotation
PURPOSE
This module defines rotation matrices and evaluates the spherical
rotation/rotateTo [ Functions ]
[ Top ] [ rotation ] [ Functions ]
NAME
function rotateTo(targ, v_in)
PURPOSE
Rotate some vector with the same matrix as one would use to rotate the z-axis onto a vector 'targ'.
INPUTS
- real, dimension(1:3) :: targ -- Target vector
- real, dimension(1:3) :: v_in -- Vector before rotation
OUTPUT
- real, dimension(1:3) :: v_out -- Vector after rotation
USAGE
rotation/rotateFrom [ Functions ]
[ Top ] [ rotation ] [ Functions ]
NAME
function rotateFrom(targ, v_in)
PURPOSE
Rotates some vector with the same matrix as one would use to rotate the vector 'targ' onto the z-axis
INPUTS
- real, dimension(1:3) :: targ -- Target vector
- real, dimension(1:3) :: v_in -- Vector before rotation
OUTPUT
- real, dimension(1:3) :: v_out -- Vector after rotation
USAGE
- calling b = rotateFrom( a, a ) b is (/ 0., 0., |a| /)
- calling b = rotateTo( a, (/ 0., 0., 1. /) ) c = rotateFrom( a, b ) c is (/ 0., 0., 1. /) again.
rotation/rotateYZ [ Functions ]
[ Top ] [ rotation ] [ Functions ]
NAME
function rotateYZ(theta, phi, v_in, cosTheta)
PURPOSE
Does first a rotation around the y-axis with angle theta, then around z with angle phi.
Rotates the z-axis on a vector which has the spherical coordinates theta and phi.
INPUTS
- real :: phi -- Angle around z-axis
- real :: theta -- Angle around y-Axis
- real, dimension(1:3) :: v_in -- Vector before rotation
- real, OPTIONAL :: cosTheta -- cos(theta)
OUTPUT
- real, dimension(1:3) :: v_out -- Vector after rotation
NOTES
if optional parameter cosTheta is given, cosT and sinT are calculated using this parameter instead of theta
rotation/rotateYZback [ Functions ]
[ Top ] [ rotation ] [ Functions ]
NAME
function rotateYZback(theta, phi, v_in, cosTheta)
PURPOSE
Does first a rotation around the z-axis with angle -theta, then around y with angle -phi.
Is the back rotation performed by rotateYZ
INPUTS
- real :: phi -- Angle around z-axis
- real :: theta -- Angle around y-Axis
- real, dimension(1:3) :: v_in -- Vector before rotation
- real, OPTIONAL :: cosTheta -- cos(theta)
OUTPUT
- real, dimension(1:3) :: v_out -- Vector after rotation
NOTES
if optional parameter cosTheta is given, cosT and sinT are calculated using this parameter instead of theta
rotation/rotateZY [ Functions ]
[ Top ] [ rotation ] [ Functions ]
NAME
function rotateZY(theta, phi, v_in, cosTheta)
PURPOSE
Does first rotation around z and thereafter around y.
As a result, e.g. the vector which had originally the spherical coordinates theta and phi is now rotated on the z-Axis. It's basically the inverse of rotateYZ.
INPUTS
- real :: phi -- Angle around z-axis [radian]
- real :: theta -- Angle around y-Axis [radian]
- real, dimension(1:3) :: v_in -- Vector before rotation
- real, OPTIONAL :: cosTheta -- cos(theta)
OUTPUT
- real, dimension(1:3) :: v_out -- Vector after rotation
NOTES
if optional parameter cosTheta is given, cosT and sinT are calculated using this parameter instead of theta
rotation/get_phi_theta [ Subroutines ]
[ Top ] [ rotation ] [ Subroutines ]
NAME
subroutine get_phi_theta(vector, theta, phi)
PURPOSE
Translate the input "vector" into spherical coordinates. Returns phi and theta of vector:
- x-axis defines phi=0
- z-axis defines theta=0
INPUTS
- real, dimension(1:3) :: vector --
OUTPUT