(arg quaternion)
Argument of quaternion, atan2(|vector(q)|, re(q))
Argument of quaternion, atan2(|vector(q)|, re(q))
(complex->quaternion z)
Create quaternion from complex number
Create quaternion from complex number
(conjugate quaternion)
Returns conjugate of quaternion
Returns conjugate of quaternion
(delta-eq q1 q2)
(delta-eq q1 q2 accuracy)
Compare quaternions with given accuracy (10e-6 by default)
Compare quaternions with given accuracy (10e-6 by default)
(from-angles [x y z])
(from-angles x y z)
Convert Tait–Bryan angles z-y′-x" to quaternion.
Convert Tait–Bryan angles z-y′-x" to quaternion.
(from-euler [roll pitch yaw])
(from-euler roll pitch yaw)
Convert Euler ZYX (body 3-2-1) representation to quaternion
Input should be 3d vector contating roll (x), pitch (y) and yaw (z) angles, or individual values.
[-pi, pi]
range[-pi/2, pi/2]
rangeConvert Euler ZYX (body 3-2-1) representation to quaternion Input should be 3d vector contating roll (x), pitch (y) and yaw (z) angles, or individual values. * roll and yaw should be from `[-pi, pi]` range * pitch should be from `[-pi/2, pi/2]` range
(from-rotation-matrix m)
Convert rotation 3x3 matrix to a quaternion
Convert rotation 3x3 matrix to a quaternion
(imaginary? quaternion)
Is q is a pure imaginary number?
Is q is a pure imaginary number?
(norm quaternion)
Norm of the quaternion, length of the vector
Norm of the quaternion, length of the vector
(qsgn q)
(qsgn re im-i im-j im-k)
sgn of the quaternion.
Returns 0
for 0+0i+0j+0k
or calls m/sgn
on real part otherwise.
sgn of the quaternion. Returns `0` for `0+0i+0j+0k` or calls `m/sgn` on real part otherwise.
(quaternion a)
(quaternion scalar [i j k])
(quaternion a b c d)
Create quaternion from individual values or scalar and vector parts, reprezented as Vec4
.
Create quaternion from individual values or scalar and vector parts, reprezented as `Vec4`.
(re quaternion)
Returns scalar part of quaternion
Returns scalar part of quaternion
(rotate in rotq)
(rotate in angle u)
Rotate 3d in
vector around axis u
, the same as fastmath.vector/axis-rotate
.
Rotate 3d `in` vector around axis `u`, the same as `fastmath.vector/axis-rotate`.
(rotation-quaternion angle u)
Create rotation quaternion around vector u and angle alpha
Create rotation quaternion around vector u and angle alpha
(scalar quaternion)
Returns scalar part of quaternion, double
Returns scalar part of quaternion, double
(to-angles q)
Convert quaternion to Tait–Bryan angles, z-y′-x".
Convert quaternion to Tait–Bryan angles, z-y′-x".
(to-euler q)
Convert quaternion to Euler ZYX (body 3-2-1). Quaternion will be normalized before calculations.
Output will contain roll (x), pitch (y) and yaw (z) angles.
Convert quaternion to Euler ZYX (body 3-2-1). Quaternion will be normalized before calculations. Output will contain roll (x), pitch (y) and yaw (z) angles.
(to-rotation-matrix q)
Convert quaternion to rotation 3x3 matrix
Convert quaternion to rotation 3x3 matrix
(vector quaternion)
Returns vector part of quaternion, Vec3
type
Returns vector part of quaternion, `Vec3` type
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close