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

Add InfinitesimalRotation #199

Closed
wants to merge 3 commits into from

Conversation

hyrodium
Copy link
Collaborator

This PR fixes #198.

I've introduced the following types:

  • InfinitesimalRotation
  • InfinitesimalRotMatrix
  • InfinitesimalRotationVec
  • InfinitesimalAngle2d

Note that this is just a quick fix for exp(log(::UnitQuaternion)) isa Rotation{3}. so, I haven't added enough tests for now.

julia> using Rotations

julia> m = rand(3,3)
3×3 ^[[AMatrix{Float64}:
^[[A^[[A^[[A 0.116692  0.853162  0.436719
 0.189983  0.270279  0.397227
 0.18174   0.268436  0.72791

julia> s = InfinitesimalRotMatrix{3}(m - m')
3×3 InfinitesimalRotMatrix{3, Float64, 9} with indices SOneTo(3)×SOneTo(3):
  0.0        0.663178  0.254978
 -0.663178   0.0       0.12879
 -0.254978  -0.12879   0.0

julia> exp(s)
3×3 RotationVec{Float64} with indices SOneTo(3)×SOneTo(3)(-0.12879, 0.254978, -0.663178):
  0.758369   0.591313  0.274273
 -0.62275    0.781548  0.0369486
 -0.192509  -0.198824  0.960942

julia> log(exp(s))
3×3 InfinitesimalRotationVec{Float64} with indices SOneTo(3)×SOneTo(3)(-0.12879, 0.254978, -0.663178):
  0.0        0.663178  0.254978
 -0.663178   0.0       0.12879
 -0.254978  -0.12879   0.0

julia> log(exp(s)) + s
3×3 InfinitesimalRotMatrix{3, Float64, 9} with indices SOneTo(3)×SOneTo(3):
  0.0        1.32636  0.509957
 -1.32636    0.0      0.25758
 -0.509957  -0.25758  0.0

julia> rotation_angle(exp(log(exp(s)) + s))
1.4441697210115163

julia> rotation_angle(exp(s))
0.7220848605057582

julia> InfinitesimalRotationVec(s)
3×3 InfinitesimalRotationVec{Float64} with indices SOneTo(3)×SOneTo(3)(-0.12879, 0.254978, -0.663178):
  0.0        0.663178  0.254978
 -0.663178   0.0       0.12879
 -0.254978  -0.12879   0.0

@hyrodium hyrodium requested a review from andyferris November 14, 2021 05:34
@codecov
Copy link

codecov bot commented Nov 14, 2021

Codecov Report

❗ No coverage uploaded for pull request base (hotfixes/v1.0.5@1a0ae63). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                 @@
##             hotfixes/v1.0.5     #199   +/-   ##
==================================================
  Coverage                   ?   79.53%           
==================================================
  Files                      ?       15           
  Lines                      ?     1451           
  Branches                   ?        0           
==================================================
  Hits                       ?     1154           
  Misses                     ?      297           
  Partials                   ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a0ae63...259ec0c. Read the comment docs.

@hyrodium hyrodium mentioned this pull request Nov 14, 2021
@hyrodium
Copy link
Collaborator Author

I'll close this PR because we won't release v1.0.5 (#198 (comment))

@hyrodium hyrodium closed this Nov 16, 2021
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