rot2quat: Converting a rotation matrix on SO(3) to an unsigned unit...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/rot2quat.R

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

1

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

1
2
3
4
5
6
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

Example output

sh: 1: wc: Permission denied
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
            [,1]        [,2]       [,3]
[1,]  0.05143314  0.77506409 -0.6297859
[2,] -0.97648783 -0.09316352 -0.1944018
[3,] -0.20934695  0.62497697  0.7520490
[1] -0.3132681  0.1607439  0.6696602 -0.6538957
[1]  0.3132681 -0.1607439 -0.6696602  0.6538957

Directional documentation built on May 26, 2021, 5:07 p.m.