Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Quaternions for Rotate3 #314

Merged
merged 8 commits into from
Nov 29, 2020
Merged

Use Quaternions for Rotate3 #314

merged 8 commits into from
Nov 29, 2020

Conversation

isovector
Copy link
Contributor

@isovector isovector commented Nov 26, 2020

This PR replaces the 3d implementations of rotation with one based on quaternions. There were previously four separate implementations of rotation, and at least one (#313) but more likely two were wrong.

By using @ekmett's industrial-strength linear algebra package, we can consolidate all four implementations into two library calls. This package is already in the transitive dependencies, and is a step towards #286.

The result: we now have the identity getBox (rotate3 (2 * pi, 0, 0) x) = getBox x (well, with error O(1e-16)).

Furthermore, it removes the Rotate3V primitive, which was just a quaternion encoding in disguise.

Fixes #313.

@isovector isovector marked this pull request as draft November 26, 2020 23:53
@isovector isovector marked this pull request as ready for review November 27, 2020 07:16
@isovector isovector changed the title [wip] use Quaternions for Rotate3 Use Quaternions for Rotate3 Nov 27, 2020
@isovector
Copy link
Contributor Author

What a fitting PR number :)

@julialongtin
Copy link
Member

Just wait until PR #628, where we rip this all out and switch to rotors. Projective Geometric Algebra is fun!

@julialongtin julialongtin merged commit 7c5def0 into Haskell-Things:master Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getBox3 for RotateV is wrong
2 participants