Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rot2quat

Converting a rotation matrix on SO(3) to an unsigned unit quaternion


Description

It returns an unsigned unite quaternion in S^3 (the four-dimensional sphere) from a 3 \times 3 rotation matrix on SO(3).

Usage

rot2quat(X)

Arguments

X

A rotation matrix in SO(3).

Details

Firstly construct a system of linear equations by equating the corresponding components of the theoretical rotation matrix proposed by Prentice (1986), and given a rotation matrix. Finally, the system of linear equations are solved by following the tricks mentioned in second reference here in order to achieve numerical accuracy to get quaternion values.

Value

A unsigned unite quaternion.

Author(s)

Anamul Sajib

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

References

Prentice,M. J. (1986). Orientation statistics without parametric assumptions.Journal of the Royal Statistical Society. Series B: Methodological 48(2). //http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm

See Also

quat2rot, rotation, Arotation \ link{rot.matrix}

Examples

x <- rnorm(4)
x <- x/sqrt( sum(x^2) ) ## an unit quaternion in R4 ##
R <- quat2rot(x)
R
x
rot2quat(R) ## sign is not exact as you can see

Directional

A Collection of R Functions for Directional Data Analysis

v4.9
GPL-2
Authors
Michail Tsagris, Giorgos Athineou, Anamul Sajib, Eli Amson, Micah J. Waldstein
Initial release
2021-03-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.