JuliaGeometry / Rotations.jl

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

Add plotting recipes #284

Closed hyrodium closed 7 months ago

hyrodium commented 7 months ago

This PR fixes #279.

julia> using Plots, Rotations

julia> plot(rand(QuatRotation); linewidth=3)

julia> plot!(rand(QuatRotation); linewidth=3, origin=(1,0,0))

https://github.com/JuliaGeometry/Rotations.jl/assets/7488140/8235368d-85f5-4b0c-8707-ee947e477448

hyrodium commented 7 months ago

Perhaps the origin points should be a cube, not a disk.

hyrodium commented 7 months ago

Visualizing Slerp

using Rotations
using Plots
using Random
plotly()
Random.seed!(42)
R1 = rand(QuatRotation)
R2 = rand(QuatRotation)

plot(R1; linewidth=3, label="R1")
plot!(R2; linewidth=3, label="R2", origin=(1,0,0))

N = 12
for i in 2:N-1
    t = i/N
    plot!(slerp(R1,R2,t); linewidth=3, label=nothing, origin=(t,0,0), boxsize=0.0, axissize=3/4)
end
plot!()

https://github.com/JuliaGeometry/Rotations.jl/assets/7488140/65a769c8-742a-4ac5-abbf-50b450a6e25d

hyrodium commented 7 months ago

TODO

hyrodium commented 7 months ago
using Rotations
using Plots
plot(Angle2d(0.2); aspectratio=1)
plot!(Angle2d(0.3); aspectratio=1)

image

codecov[bot] commented 7 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (5407354) 90.44% compared to head (1478a4f) 90.63%. Report is 3 commits behind head on master.

Files Patch % Lines
ext/RotationsRecipesBaseExt.jl 96.07% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #284 +/- ## ========================================== + Coverage 90.44% 90.63% +0.19% ========================================== Files 17 18 +1 Lines 1664 1709 +45 ========================================== + Hits 1505 1549 +44 - Misses 159 160 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.