Module

GLMatrix.Quat

#Quat

data Quat :: Type

Instances

#all

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

#equals

equals :: Quat -> Quat -> Boolean

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

#exactEquals

exactEquals :: Quat -> Quat -> Boolean

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

#length

length :: Quat -> Number

Calculates the length of a quat

#sqlerp

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

Performs a spherical linear interpolation with two control points

#add

add :: Quat -> Quat -> Quat

Adds two quat's

#calculateW

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.

#conjugate

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.

#dot

dot :: Quat -> Quat -> Quat

Calculates the dot product of two quat's

#exp

exp :: Quat -> Quat

Calculate the exponential of a unit quaternion.

#fromEuler

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

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

#fromValues

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

Creates a new quat initialized with the given values

#getAngle

getAngle :: Quat -> Quat -> Number

Gets the angular distance between two unit quaternions

#identity

identity :: Quat

Gets the angular distance between two unit quaternions

#invert

invert :: Quat -> Quat

Calculates the inverse of a quat

#lerp

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

Performs a linear interpolation between two quat's

#ln

ln :: Quat -> Quat

Calculate the natural logarithm of a unit quaternion.

#multiply

multiply :: Quat -> Quat -> Quat

Multiplies two quat's

#normalize

normalize :: Quat -> Quat

Normalize a quat

#pow

pow :: Quat -> Number -> Quat

Calculate the scalar power of a unit quaternion.

#rotateX

rotateX :: Quat -> Number -> Quat

Rotates a quaternion by the given angle about the X axis

#rotateY

rotateY :: Quat -> Number -> Quat

Rotates a quaternion by the given angle about the Y axis

#rotateZ

rotateZ :: Quat -> Number -> Quat

Rotates a quaternion by the given angle about the Z axis

#scale

scale :: Quat -> Number -> Quat

Scales a quat by a scalar number

#slerp

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

Performs a spherical linear interpolation between two quat

#squaredLength

squaredLength :: Quat -> Number

Calculates the squared length of a quat

#subtract

subtract :: Quat -> Quat -> Quat

Subtracts from Quat from the other

#numbers

numbers :: Quat -> Array Number

Extract a number array

#unsafeFromNumbers

unsafeFromNumbers :: Partial => Array Number -> Quat

Create a vector from an array produced by numbers.

#map

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.

#zipWith

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

#slice

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

Like Array.slice

Modules