In the current version of Rotations.jl, rotating a vector of quantities with AngleAxis returns a new vector with incorrect eltype:
julia> R = AngleAxis(π / 2, 0, 0, 1)
3×3 AngleAxis{Float64} with indices SOneTo(3)×SOneTo(3)(1.5708, 0.0, 0.0, 1.0):
2.22045e-16 -1.0 0.0
1.0 2.22045e-16 0.0
0.0 0.0 1.0
julia> v = SVector(1.0, 1.0, 1.0) * u"m"
3-element SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}} with indices SOneTo(3):
1.0 m
1.0 m
1.0 m
julia> R * v
3-element SVector{3, Quantity{Float64}} with indices SOneTo(3):
-0.9999999999999999 m
1.0 m
1.0 m
This PR fixes this bug:
julia> R = AngleAxis(π / 2, 0, 0, 1)
3×3 AngleAxis{Float64} with indices SOneTo(3)×SOneTo(3)(1.5708, 0.0, 0.0, 1.0):
2.22045e-16 -1.0 0.0
1.0 2.22045e-16 0.0
0.0 0.0 1.0
julia> v = SVector(1.0, 1.0, 1.0) * u"m"
3-element SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}} with indices SOneTo(3):
1.0 m
1.0 m
1.0 m
julia> R * v
3-element SVector{3, Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}} with indices SOneTo(3):
-0.9999999999999999 m
1.0 m
1.0 m
In the current version of Rotations.jl, rotating a vector of quantities with
AngleAxis
returns a new vector with incorrect eltype:This PR fixes this bug: