Liking cljdoc? Tell your friends :D

mathree.quaternion


from-axis-anglecljs

(from-axis-angle axis angle)

Sets this quaternion from rotation specified by axis and angle. Adapted from the method here. Axis is assumed to be normalized, angle is in radians.

Sets this quaternion from rotation specified by axis and angle.
Adapted from the method here.
Axis is assumed to be normalized, angle is in radians.
sourceraw docstring

from-eulercljs

(from-euler e)

Sets this quaternion from the rotation specified by Euler angle.

Sets this quaternion from the rotation specified by Euler angle.
sourceraw docstring

from-rotation-matrixcljs

(from-rotation-matrix m4)

m - a Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled). Sets this quaternion from rotation component of m.

m - a Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).
Sets this quaternion from rotation component of m.
sourceraw docstring

from-seqcljs

source

from-unit-vectorscljs

(from-unit-vectors v-from v-to)

Sets this quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo.

Sets this quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo.
sourceraw docstring

identity-quaternioncljs

(identity-quaternion)

Sets this quaternion to the identity quaternion; that is, to the quaternion that represents no rotation.

Sets this quaternion to the identity quaternion; that is, to the quaternion that represents no rotation.
sourceraw docstring

IQuanternioncljsprotocol

dotcljs

(dot q1 q2)

Calculates the dot product of quaternions v and this one.

Calculates the dot product of quaternions v and this one.

angle-tocljs

(angle-to q1 q2)

Returns the angle between this quaternion and quaternion q in radians.

Returns the angle between this quaternion and quaternion q in radians.

normalizecljs

(normalize q)

Normalizes this quaternion - that is, calculated the quaternion that performs the same rotation as this one, but has length equal to 1.

Normalizes this quaternion - that is, calculated the quaternion that performs the same rotation as this one, but has length equal to 1.

invertcljs

(invert q)

Inverts this quaternion - calculates the conjugate. The quaternion is assumed to have unit length.

Inverts this quaternion - calculates the conjugate. The quaternion is assumed to have unit length.

slerpcljs

(slerp q1 q2 t)

q2 - The other quaternion rotation. t - interpolation factor in the closed interval [0, 1].

q2 - The other quaternion rotation. t - interpolation factor in the closed interval [0, 1].

conjugatecljs

(conjugate q)

Returns the rotational conjugate of this quaternion. The conjugate of a quaternion represents the same rotation in the opposite direction about the rotational axis.

Returns the rotational conjugate of this quaternion. The conjugate of a quaternion represents the same rotation in the opposite direction about the rotational axis.

length-sqcljs

(length-sq q)

Computes the squared Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector. This can be useful if you are comparing the lengths of two quaternions, as this is a slightly more efficient calculation than length().

Computes the squared Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector. This can be useful if you are comparing the lengths of two quaternions, as this is a slightly more efficient calculation than length().

almost-equalscljs

(almost-equals q1 q2)

Return true if q1 and q2 are almost equal. every element is less than 0.000001.

Return true if q1 and q2 are almost equal. every element is less than 0.000001.

equalscljs

(equals q1 q2)

Quaternion that this quaternion will be compared to.

Quaternion that this quaternion will be compared to.

clone'cljs

(clone' q)

Creates a new Quaternion with identical x, y, z and w properties to this one.

Creates a new Quaternion with identical x, y, z and w properties to this one.

lengthcljs

(length q)

Computes the Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector.

Computes the Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector.

rotate-towardscljs

(rotate-towards q1 q2 step)

q - The target quaternion. step - The angular step in radians.

q - The target quaternion. step - The angular step in radians.

multiplycljs

(multiply q1 q2)

Sets this quaternion to a x b.

Sets this quaternion to a x b.
source

quaternioncljs

(quaternion)
(quaternion x y z w)

Quaternion( x : Float, y : Float, z : Float, w : Float ) x - x coordinate y - y coordinate z - z coordinate w - w coordinate

Quaternion( x : Float, y : Float, z : Float, w : Float )
x - x coordinate
y - y coordinate
z - z coordinate
w - w coordinate
sourceraw docstring

quatncljs

(quatn v)

convert a vector of 4 elements to quanternion

 convert a vector of 4 elements to quanternion
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close