JuliaGeometry / Rotations.jl

Julia implementations for different rotation parameterizations
https://juliageometry.github.io/Rotations.jl
MIT License
180 stars 44 forks source link

Provide a no-op `convert` #200

Closed timholy closed 2 years ago

timholy commented 2 years ago

This should help performance, but it also resolved a subtle bug that crops up if you perform autodiff with respect to AngleAxis coordinates at the origin: sqrt(dual(0.0)) gives you NaNs. Those cropped up because AngleAxis doesn't remember if you called it with normalize=false.

codecov[bot] commented 2 years ago

Codecov Report

Merging #200 (ef874f4) into master (15d1c32) will decrease coverage by 0.28%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
- Coverage   86.12%   85.84%   -0.29%     
==========================================
  Files          14       14              
  Lines        1341     1342       +1     
==========================================
- Hits         1155     1152       -3     
- Misses        186      190       +4     
Impacted Files Coverage Δ
src/core_types.jl 89.62% <100.00%> (-0.67%) :arrow_down:
src/euler_types.jl 91.68% <0.00%> (-0.74%) :arrow_down:

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 15d1c32...ef874f4. Read the comment docs.

hyrodium commented 2 years ago

autodiff with respect to AngleAxis coordinates at the origin: sqrt(dual(0.0)) gives you NaNs.

Just a comment, is there any case to calculate differentiation on the origin? I think the vector of AngleAxis is assumed to be of unit length.