diff --git a/src/rotation_generator.jl b/src/rotation_generator.jl index 164ddd44..81f6607f 100644 --- a/src/rotation_generator.jl +++ b/src/rotation_generator.jl @@ -156,6 +156,7 @@ end end end +@inline params(r::Angle2dGenerator) = SVector{1}(r.v) """ struct RotationVecGenerator{T} <: RotationGenerator{2,T} @@ -216,6 +217,7 @@ end end end +@inline params(r::RotationVecGenerator) = SVector{3}(r.x,r.y,r.z) ################################################################################ ################################################################################ diff --git a/test/rotation_generator.jl b/test/rotation_generator.jl index 95305a1a..83d6b828 100644 --- a/test/rotation_generator.jl +++ b/test/rotation_generator.jl @@ -170,6 +170,11 @@ @test_throws DimensionMismatch Angle2dGenerator(1) + RotationVecGenerator(2,3,4) end + @testset "params" begin + @test Rotations.params(Angle2dGenerator(1)) == [1] + @test Rotations.params(RotationVecGenerator(2,3,4)) == [2,3,4] + end + @testset "type promotion" begin for (T, N) in ((Angle2dGenerator, 2), (RotationVecGenerator, 3)) R = RotMatrixGenerator