orientlib (version 0.10.5)

quaternion: Create an orientation using quaternions

Description

Creates a quaternion-class object.

Usage

quaternion(m)

Value

A quaternion-class object.

Arguments

m

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

Author

Duncan Murdoch

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
x <- quaternion(c(1,0,0,0))
x
rotmatrix(x)

Run the code above in your browser using DataLab