JuliaSpace / ReferenceFrameRotations.jl

A toolbox to represent 3D rotations of coordinate frames for Julia language.
MIT License
59 stars 13 forks source link

problem with dcm_to_quat for simple rotation #23

Closed cchderrick closed 2 years ago

cchderrick commented 2 years ago

A matrix represented a simple rotation; swapping the x and y.

julia> dcm = [0 1 0;1 0 0;0 0 1] |> SMatrix{3,3,Float64}
3×3 SMatrix{3, 3, Float64, 9} with indices SOneTo(3)×SOneTo(3):
 0.0  1.0  0.0
 1.0  0.0  0.0
 0.0  0.0  1.0

It doesn't rotate back.

julia> dcm_to_quat(dcm) |> quat_to_dcm
3×3 SMatrix{3, 3, Float64, 9} with indices SOneTo(3)×SOneTo(3):
 0.5  0.0  0.0
 0.0  0.5  0.0
 0.0  0.0  0.5
cchderrick commented 2 years ago

hmm, I guess it is not a "rotation"

ronisbr commented 2 years ago

Hi @cchderrick!

You are right. This DCM has determinant -1, indicating it has mirroring.