Dav1dde / gl3n

OpenGL Maths for D (not glm for D).
http://dav1dde.github.com/gl3n/
Other
103 stars 49 forks source link

Quaternion inverse is not the same as conjugate #95

Open mbierlee opened 1 year ago

mbierlee commented 1 year ago

In https://github.com/Dav1dde/gl3n/blob/a010ceac612072ee5e945be75c577af630ed0674/gl3n/linalg.d#L2097-L2108

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