moble / quaternionic

Interpret numpy arrays as quaternionic arrays with numba acceleration
MIT License
84 stars 7 forks source link

Allow numpy to compute the angle of a quaternion #38

Closed moble closed 2 years ago

moble commented 2 years ago

If q = np.exp(v̂ * θ/2) for some unit vector and an angle θ ∈[-2π,2π], then np.angle returns abs(θ). This equals 2*abs(log(q)), but is more efficient.

codecov[bot] commented 2 years ago

Codecov Report

Merging #38 (fa7a62f) into main (26a32e3) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #38   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines         1037      1051   +14     
  Branches       113       117    +4     
=========================================
+ Hits          1037      1051   +14     
Impacted Files Coverage Δ
quaternionic/converters.py 100.00% <ø> (ø)
quaternionic/algebra.py 100.00% <100.00%> (ø)
quaternionic/arrays.py 100.00% <100.00%> (ø)

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 7c4e853...fa7a62f. Read the comment docs.