The Quaternion.equals()
method is used to compare two quaternions and check whether they are equal or not. It returns true
if both the quaternions have the same values for the x
, y
, z
and w
components, false
otherwise.
quaternion.equals( other )
other
: The quaternion to compare.true
if the two quaternions are equal, false
otherwise.const quat1 = new THREE.Quaternion(0.707, 0, 0, 0.707);
const quat2 = new THREE.Quaternion(0.707, 0, 0, 0.707);
const result = quat1.equals(quat2);
console.log(result); // true
Quaternion
is a class that represents a 4D vector used to encode rotations in 3D space. It is implemented using the Vector4
class in three.js.q1 * q2
is not equal to q2 * q1
in general.