quaternion: Create an orientation using quaternions

View source: R/orientlib.r

quaternionR Documentation

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

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.

Value

A quaternion-class object.

Author(s)

Duncan Murdoch

See Also

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

Examples

x <- quaternion(c(1,0,0,0))
x
rotmatrix(x)

orientlib documentation built on Jan. 10, 2023, 5:14 p.m.