orientlib (version 0.10.3)

quaternion: Create an orientation using quaternions

Description

Creates a quaternion-class object.

Usage

quaternion(m)

Arguments

m

n x 4 matrix or 4 element vector containing a unit quaternion, or an orientation object

Value

A quaternion-class object.

Details

The rows of m are 4 element unit vectors interpreted as follows: the first 3 (x,y,z) define the axis of rotation, and the last element gives the cosine of half the angle of rotation in a counter-clockwise direction when looking down the axis towards the origin.

See Also

quaternion-class, rotmatrix, rotvector, eulerzyx, eulerzxz, skewvector, skewmatrix

Examples

Run this code
# NOT RUN {
x <- quaternion(c(1,0,0,0))
x
rotmatrix(x)
# }

Run the code above in your browser using DataLab