Module

GLMatrix.Quat

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

#Quat Source

data Quat :: Type

Instances

#all Source

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

#equals Source

equals :: Quat -> Quat -> Boolean

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

#exactEquals Source

exactEquals :: Quat -> Quat -> Boolean

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

#length Source

length :: Quat -> Number

Calculates the length of a quat

#sqlerp Source

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

Performs a spherical linear interpolation with two control points

#add Source

add :: Quat -> Quat -> Quat

Adds two quat's

#calculateW Source

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 Source

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 Source

dot :: Quat -> Quat -> Quat

Calculates the dot product of two quat's

#exp Source

exp :: Quat -> Quat

Calculate the exponential of a unit quaternion.

#fromEuler Source

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

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

#fromValues Source

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

Creates a new quat initialized with the given values

#getAngle Source

getAngle :: Quat -> Quat -> Number

Gets the angular distance between two unit quaternions

#identity Source

identity :: Quat

Gets the angular distance between two unit quaternions

#invert Source

invert :: Quat -> Quat

Calculates the inverse of a quat

#lerp Source

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

Performs a linear interpolation between two quat's

#ln Source

ln :: Quat -> Quat

Calculate the natural logarithm of a unit quaternion.

#multiply Source

multiply :: Quat -> Quat -> Quat

Multiplies two quat's

#normalize Source

normalize :: Quat -> Quat

Normalize a quat

#pow Source

pow :: Quat -> Number -> Quat

Calculate the scalar power of a unit quaternion.

#rotateX Source

rotateX :: Quat -> Number -> Quat

Rotates a quaternion by the given angle about the X axis

#rotateY Source

rotateY :: Quat -> Number -> Quat

Rotates a quaternion by the given angle about the Y axis

#rotateZ Source

rotateZ :: Quat -> Number -> Quat

Rotates a quaternion by the given angle about the Z axis

#scale Source

scale :: Quat -> Number -> Quat

Scales a quat by a scalar number

#slerp Source

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

Performs a spherical linear interpolation between two quat

#squaredLength Source

squaredLength :: Quat -> Number

Calculates the squared length of a quat

#subtract Source

subtract :: Quat -> Quat -> Quat

Subtracts from Quat from the other

#numbers Source

numbers :: Quat -> Array Number

Extract a number array

#unsafeFromNumbers Source

unsafeFromNumbers :: Partial => Array Number -> Quat

Create a vector from an array produced by numbers.

#map Source

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 Source

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

#slice Source

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

Like Array.slice