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

+ handle rotation matrix ambiguities #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SteSeg
Copy link
Contributor

@SteSeg SteSeg commented Dec 11, 2024

While converting some benchmarks we were finding some issues with quadric surface rotations. Apparently, in the case of 45 degrees rotation and degenerate eigenvalues of the coefficient matrix numpy does not know how to unambiguously order the eigenvectors in the rotation matrix. @davidepettinari and I think we have found a solution to this and we added a function able to reorder the rotation matrix according to two criteria. First the eigenvectors are ordered so their element with the highest absolute value stand on the diagonal. Then, if there is still ambiguity, it orders the ambiguous eigenvectors left in order to achieve orthogonality.

We went from this (not meshable):

image

To this (meshable):

image

@SteSeg
Copy link
Contributor Author

SteSeg commented Dec 11, 2024

Just rewrote the function to explicitly make sure the built rotation matrix is also right handed.

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.

1 participant