Fix Quaternion biAlign #705

Closed
opened 2026-04-05 21:28:25 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @AxisAngles on 6/25/2024

Fixed biAlign. (Syntax check and formatting needed)

Added: Safety unitization in case of non unit axes.
Fixed: Found bQ was evaluated as "a.dot(Q.xyz)" instead of "b.dot(Q.xyz)"
Fixed: abQ was missing term "- a.dot(b)*rot.w"
Fixed: angleA was maximizing error instead of minimizing
Fixed: angleB was not consistently giving a value between -pi and pi

I came back to this code to use it for some research, and turns out there were some severe mistakes or typos. This is re-derived from the ground up and the lua version is tested a fair bit. This is a translation of Lua to Kotlin, so there might be some syntax errors, but the math is correct now.

*Originally created by @AxisAngles on 6/25/2024* Fixed biAlign. (Syntax check and formatting needed) Added: Safety unitization in case of non unit axes. Fixed: Found bQ was evaluated as "a.dot(Q.xyz)" instead of "b.dot(Q.xyz)" Fixed: abQ was missing term "- a.dot(b)*rot.w" Fixed: angleA was maximizing error instead of minimizing Fixed: angleB was not consistently giving a value between -pi and pi I came back to this code to use it for some research, and turns out there were some severe mistakes or typos. This is re-derived from the ground up and the lua version is tested a fair bit. This is a translation of Lua to Kotlin, so there might be some syntax errors, but the math is correct now.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/SlimeVR-Server#705