Rotations.jl icon indicating copy to clipboard operation
Rotations.jl copied to clipboard

`principal_value(::RotXYX)` does not return principal value

Open hyrodium opened this issue 4 years ago • 0 comments

julia> using Rotations

julia> principal_value(RotXYX(0.1,0,-0.1))
3×3 RotXYX{Float64} with indices SOneTo(3)×SOneTo(3)(0.1, 0.0, -0.1):
  1.0  -0.0  0.0
  0.0   1.0  0.0
 -0.0   0.0  1.0

julia> principal_value(RotXYX(0.1,0,-0.1)) == RotXYX(0,0,0)
true

This is because the principal_value method makes sure that the angles are between -π and π. (https://github.com/JuliaGeometry/Rotations.jl/blob/v1.0.4/src/principal_value.jl#L82)

hyrodium avatar Nov 11 '21 11:11 hyrodium