It looks like vector rotation does not work or I am missing something:
using CoordinateTransformations, Rotations, StaticArrays, AngleBetweenVectors
julia> vec = [1.0,2.0,3.0]
3-element Vector{Float64}:
1.0
2.0
3.0
julia> rotated = LinearMap(RotZ(0))(vec)
3-element SVector{3, Float64} with indices SOneTo(3):
1.0
2.0
3.0
julia> angle(vec, Vector(rotated)) # OK
0.0
julia> rotated = LinearMap(RotZ(2pi))(vec)
3-element SVector{3, Float64} with indices SOneTo(3):
1.0000000000000004
1.9999999999999998
3.0
julia> angle(vec, Vector(rotated)) # OK
1.5700924586837752e-16
julia> rotated = LinearMap(RotZ(0.42))(vec)
3-element SVector{3, Float64} with indices SOneTo(3):
0.09756803419316795
2.2339383336841867
3.0
julia> angle(vec, Vector(rotated)) # Not OK
0.24980625896217093
julia> rotated = LinearMap(RotZ(0.7))(vec)
3-element SVector{3, Float64} with indices SOneTo(3):
-0.5235931871908935
2.1739020618066682
3.0
julia> angle(vec, Vector(rotated)) # Not OK
0.4127652411766173
I.e. rotating by 0 or 2pi results a correct angle but rotation angles in between do not.
Any suggestions?