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

exp(Rotations.UnitQuaternion(0, π, 0, 0)) gives incorrect result #128

Closed
bzinberg opened this issue Jul 24, 2020 · 2 comments
Closed

exp(Rotations.UnitQuaternion(0, π, 0, 0)) gives incorrect result #128

bzinberg opened this issue Jul 24, 2020 · 2 comments

Comments

@bzinberg
Copy link

julia> exp(Rotations.UnitQuaternion(0, π, 0, 0))
3×3 UnitQuaternion{Float64} with indices SOneTo(3)×SOneTo(3)(0.540302, 0.841471, 0.0, 0.0):
 1.0   0.0        0.0     
 0.0  -0.416147  -0.909297
 0.0   0.909297  -0.416147

I would expect the result UnitQuaternion(-1.0, 0, 0, 0).

This issue might end up being superseded by a fix to #30.

@hyrodium
Copy link
Collaborator

We need to introduce skew-symmetric matrix type(#30) to solve this issue cleanly, but we can do the following for now:

julia> exp(Rotations.UnitQuaternion(0, π, 0, 0, false))
3×3 UnitQuaternion{Float64} with indices SOneTo(3)×SOneTo(3)(-1.0, 1.22465e-16, 0.0, 0.0):
 1.0   0.0          0.0
 0.0   1.0          2.44929e-16
 0.0  -2.44929e-16  1.0

The false means "do not normalize". This seems a dirty solution because it is not unit quaternion.

@hyrodium hyrodium pinned this issue Nov 20, 2021
@hyrodium hyrodium unpinned this issue Nov 20, 2021
@hyrodium hyrodium linked a pull request Nov 20, 2021 that will close this issue
@hyrodium
Copy link
Collaborator

julia> using Rotations

julia> exp(RotationVecGenerator(π,0,0))
3×3 RotationVec{Float64} with indices SOneTo(3)×SOneTo(3)(3.14159, 0.0, 0.0):
 1.0   0.0           0.0
 0.0  -1.0          -1.22465e-16
 0.0   1.22465e-16  -1.0

julia> exp(RotationVecGenerator(2π,0,0))
3×3 RotationVec{Float64} with indices SOneTo(3)×SOneTo(3)(6.28319, 0.0, 0.0):
 1.0   0.0          0.0
 0.0   1.0          2.44929e-16
 0.0  -2.44929e-16  1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants