openrndr / org.openrndr.math / Quaternion

# Quaternion

`data class Quaternion : Serializable` (source)

Quaternion class for representing orientations in 3D space

### Constructors

#### <init>

Quaternion class for representing orientations in 3D space

`Quaternion(x: Double, y: Double, z: Double, w: Double)`

### Properties

#### inversed

`val inversed: Quaternion`

#### length

`val length: Double`

#### matrix

An orthonormal basis for the orientation described by the quaternion

`val matrix: Matrix33`

#### negated

`val negated: Quaternion`

#### norm

`val norm: Double`

#### normalized

`val normalized: Quaternion`

#### w

`val w: Double`

#### x

`val x: Double`

#### y

`val y: Double`

#### z

`val z: Double`

### Functions

#### times

`operator fun times(q: Quaternion): Quaternion`
`operator fun times(vec: Vector3): Vector3`

### Companion Object Properties

#### IDENTITY

`val IDENTITY: Quaternion`

#### ZERO

`val ZERO: Quaternion`

### Companion Object Functions

#### fromAngles

Construct Quaternion from a set of degrees

`fun fromAngles(pitch: Double, roll: Double, yaw: Double): Quaternion`

Construct Quaternion from a set of arc lengths

`fun fromAnglesRadian(pitch: Double, roll: Double, yaw: Double): Quaternion`

#### fromAxes

Construct Quaternion from axes

`fun fromAxes(x: Vector3, y: Vector3, z: Vector3): Quaternion`

#### fromLookAt

Construct Quaternion using from, to and up vectors

`fun fromLookAt(from: Vector3, to: Vector3, up: Vector3 = Vector3.UNIT_Y): Quaternion`

#### fromMatrix

Construct Quaternion from Matrix33

`fun fromMatrix(m: Matrix33): Quaternion`