2D Rotation by Angle
Angle2d
is a type that internally has an angle as a parameter, and can be thought of as a lazy version of RotMatrix{2}
.
Angle2d
example
julia> t = 1.2 # rotation angle
1.2
julia> m = [cos(t) -sin(t);sin(t) cos(t)]
2×2 Matrix{Float64}: 0.362358 -0.932039 0.932039 0.362358
julia> Angle2d(t) # construct from matrix
2×2 Angle2d{Float64} with indices SOneTo(2)×SOneTo(2)(1.2): 0.362358 -0.932039 0.932039 0.362358
julia> RotMatrix{2}(t)
2×2 RotMatrix2{Float64} with indices SOneTo(2)×SOneTo(2): 0.362358 -0.932039 0.932039 0.362358
julia> dump(Angle2d(t))
Angle2d{Float64} theta: Float64 1.2
julia> dump(RotMatrix{2}(t))
RotMatrix2{Float64} mat: StaticArraysCore.SMatrix{2, 2, Float64, 4} data: NTuple{4, Float64} 1: Float64 0.3623577544766736 2: Float64 0.9320390859672263 3: Float64 -0.9320390859672263 4: Float64 0.3623577544766736