Module

# GLMatrix.Quat

Package
purescript-gl-matrix
Repository
dirkz/purescript-gl-matrix

### #QuatSource

``data Quat :: Type``

#### Instances

• `Show Quat`
• `Eq Quat`

### #allSource

``all :: forall a. HeytingAlgebra a => (Number -> a) -> Quat -> a``

### #equalsSource

``equals :: Quat -> Quat -> Boolean``

Returns whether or not the quaternions have approximately the same elements in the same position.

### #exactEqualsSource

``exactEquals :: Quat -> Quat -> Boolean``

Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)

### #lengthSource

``length :: Quat -> Number``

Calculates the length of a quat

### #sqlerpSource

``sqlerp :: Quat -> Quat -> Quat -> Quat -> Number -> Quat``

Performs a spherical linear interpolation with two control points

``add :: Quat -> Quat -> Quat``

### #calculateWSource

``calculateW :: Quat -> Quat``

Calculates the W component of a quat from the X, Y, and Z components. Assumes that quaternion is 1 unit in length. Any existing W component will be ignored.

### #conjugateSource

``conjugate :: Quat -> Quat``

Calculates the conjugate of a quat If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

### #dotSource

``dot :: Quat -> Quat -> Quat``

Calculates the dot product of two quat's

### #expSource

``exp :: Quat -> Quat``

Calculate the exponential of a unit quaternion.

### #fromEulerSource

``fromEuler :: Number -> Number -> Number -> Quat``

Creates a quaternion from the given euler angle x, y, z.

### #fromValuesSource

``fromValues :: Number -> Number -> Number -> Number -> Quat``

Creates a new quat initialized with the given values

### #getAngleSource

``getAngle :: Quat -> Quat -> Number``

Gets the angular distance between two unit quaternions

### #identitySource

``identity :: Quat``

Gets the angular distance between two unit quaternions

### #invertSource

``invert :: Quat -> Quat``

Calculates the inverse of a quat

### #lerpSource

``lerp :: Quat -> Quat -> Number -> Quat``

Performs a linear interpolation between two quat's

### #lnSource

``ln :: Quat -> Quat``

Calculate the natural logarithm of a unit quaternion.

### #multiplySource

``multiply :: Quat -> Quat -> Quat``

Multiplies two quat's

### #normalizeSource

``normalize :: Quat -> Quat``

Normalize a quat

### #powSource

``pow :: Quat -> Number -> Quat``

Calculate the scalar power of a unit quaternion.

### #rotateXSource

``rotateX :: Quat -> Number -> Quat``

Rotates a quaternion by the given angle about the X axis

### #rotateYSource

``rotateY :: Quat -> Number -> Quat``

Rotates a quaternion by the given angle about the Y axis

### #rotateZSource

``rotateZ :: Quat -> Number -> Quat``

Rotates a quaternion by the given angle about the Z axis

### #scaleSource

``scale :: Quat -> Number -> Quat``

Scales a quat by a scalar number

### #slerpSource

``slerp :: Quat -> Quat -> Number -> Quat``

Performs a spherical linear interpolation between two quat

### #squaredLengthSource

``squaredLength :: Quat -> Number``

Calculates the squared length of a quat

### #subtractSource

``subtract :: Quat -> Quat -> Quat``

Subtracts from Quat from the other

``numbers :: Quat -> Array Number``

Extract a number array

``unsafeFromNumbers :: Partial => Array Number -> Quat``

Create a vector from an array produced by `numbers`.

### #mapSource

``map :: (Number -> Number) -> Quat -> Quat``

Map a function from `Number` to `Number` over it. Note: Since this is not a general container, it cannot be a `Functor`.

### #zipWithSource

``zipWith :: (Number -> Number -> Number) -> Quat -> Quat -> Quat``

### #sliceSource

``slice :: Int -> Int -> Quat -> Array Number``

Like `Array.slice`