(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.
(from-euler e)
Sets this quaternion from the rotation specified by Euler angle.
Sets this quaternion from the rotation specified by Euler angle.
(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.
(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.
(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.
(dot q1 q2)
Calculates the dot product of quaternions v and this one.
Calculates the dot product of quaternions v and this one.
(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.
(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.
(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.
(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].
(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-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-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.
(equals q1 q2)
Quaternion that this quaternion will be compared to.
Quaternion that this quaternion will be compared to.
(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.
(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-towards q1 q2 step)
q - The target quaternion. step - The angular step in radians.
q - The target quaternion. step - The angular step in radians.
(multiply q1 q2)
Sets this quaternion to a x b.
Sets this quaternion to a x b.
(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
(quatn v)
convert a vector of 4 elements to quanternion
convert a vector of 4 elements to quanternion
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close