In
|
void invert() { |
|
x = -x; |
|
y = -y; |
|
z = -z; |
|
} |
|
alias invert conjugate; /// ditto |
|
|
|
/// Returns an inverted copy of the current quaternion. |
|
@property Quaternion inverse() const { |
|
return Quaternion(w, -x, -y, -z); |
|
} |
|
alias inverse conjugated; /// ditto |
It is stated that the inverse of a quaternion is the same as its conjugate. This is not correct. The conjugate is what it is doing now, the inverse should be conjugate / magnitude_squared.
See also:
https://www.3dgep.com/understanding-quaternions/#quaternion-conjugate
https://www.3dgep.com/understanding-quaternions/#quaternion-inverse
In
gl3n/gl3n/linalg.d
Lines 2097 to 2108 in a010cea
It is stated that the inverse of a quaternion is the same as its conjugate. This is not correct. The conjugate is what it is doing now, the inverse should be
conjugate / magnitude_squared.See also:
https://www.3dgep.com/understanding-quaternions/#quaternion-conjugate
https://www.3dgep.com/understanding-quaternions/#quaternion-inverse