rot2eul: Compute the Euler angles from a rotation matrix on SO(3). In Directional: A Collection of Functions for Directional Data Analysis

Description

It calculates three euler angles (θ_{12}, θ_{13}, θ_{23}) from a (3 \times 3) rotation matrix X, where X is defined as X = R_z(θ_{12})\times R_y(θ_{13}) \times R_x(θ_{23}). Here R_x(θ_{23}) means a rotation of θ_{23} radians about the x axis.

Usage

 1 rot2eul(X)

Arguments

 X A rotation matrix which is defined as a product of three elementary rotations mentioned above. Here θ_{12}, θ_{23} \in (-π, π) and and θ_{13} \in (-π/2, π/2).

Details

Given a rotation matrix X, euler angles are computed by equating each element in X with the corresponding element in the matrix product defined above. This results in nine equations that can be used to find the euler angles.

Value

For a given rotation matrix, there are two eqivalent sets of euler angles.

Author(s)

Anamul Sajib<sajibstat@du.ac.bd>

R implementation and documentation: Anamul Sajib<sajibstat@du.ac.bd>

References

Green, P. J. \& Mardia, K. V. (2006). Bayesian alignment using hierarchical models, with applications in proteins bioinformatics. Biometrika, 93(2):235–254.

http://www.staff.city.ac.uk/~sbbh653/publications/euler.pdf

Examples

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # three euler angles theta.12 <- sample( seq(-3, 3, 0.3), 1 ) theta.23 <- sample( seq(-3, 3, 0.3), 1 ) theta.13 <- sample( seq(-1.4, 1.4, 0.3), 1 ) theta.12 ; theta.23 ; theta.13 X <- eul2rot(theta.12, theta.23, theta.13) X ## A rotation matrix e <- rot2eul(X)\$v1 theta.12 <- e theta.23 <- e theta.13 <- e theta.12 ; theta.23 ; theta.13

Example output

 -1.5
 -2.4
 -0.2
[,1]        [,2]       [,3]
[1,]  0.06932717 -0.74503903  0.6634083
[2,] -0.97761150  0.08169649  0.1939109
[3,] -0.19866933 -0.66199889 -0.7226949
 -1.5
 -2.4
 -0.2

Directional documentation built on Nov. 8, 2021, 1:07 a.m.