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

Rotation of a vector by a matrix and a quaternion are not equivalent #97

Open
mxrie-eve opened this issue Nov 22, 2019 · 1 comment · May be fixed by #98
Open

Rotation of a vector by a matrix and a quaternion are not equivalent #97

mxrie-eve opened this issue Nov 22, 2019 · 1 comment · May be fixed by #98

Comments

@mxrie-eve
Copy link

To reproduce the bug:

m = matrix44.create_from_x_rotation(np.pi / 2.)
matrix44.apply_to_vector(m, [0., 1., 0., 1.])
# gives:
array([ 0.000000e+00, 0.000000e+00, -1.000000e+00,  1.000000e+00])

And

q = quaternion.create_from_x_rotation(np.pi / 2.)
quaternion.apply_to_vector(q, [0., 1., 0., 1.])
# gives:
array([0.00000000e+00, 0.00000000e+00, 1.00000000e+00, 1.00000000e+00])

When you test the equivalence of the relation in test_m44_q_equivalence, you rotate a unit vector on the x-axis by the x-axis. The vector won't move as it is aligned with the axis of rotation...
The bug is visible when you check with unit vectors on the y-axis or z-axis, like above.

@adamlwgriffiths
Copy link
Owner

Hey, thanks for looking into it and providing some examples.
Unfortunately I just don't have time to look at these issues.
If yourself or anyone else can address it, I'd be most greatful.

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 a pull request may close this issue.

2 participants