Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/core_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ rotation_axis(r::Rotation{3}) = rotation_axis(AngleAxis(r))
Base.convert(::Type{R}, rot::R) where {N,R<:Rotation{N}} = rot
Base.convert(::Type{R}, rot::Rotation{N}) where {N,R<:Rotation{N}} = R(rot)

# Rotation matrices should be orthoginal/unitary. Only the operations we define,
# like multiplication, will stay as Rotations, otherwise users will get an
# SMatrix{3,3} (e.g. rot1 + rot2 -> SMatrix)
Base.@pure StaticArrays.similar_type(::Union{R,Type{R}}) where {R <: Rotation} = SMatrix{size(R)..., eltype(R), prod(size(R))}
Base.@pure StaticArrays.similar_type(::Union{R,Type{R}}, ::Type{T}) where {R <: Rotation, T} = SMatrix{size(R)..., T, prod(size(R))}

@inline function Base.:/(r1::Rotation, r2::Rotation)
r1 * inv(r2)
end
Expand Down
6 changes: 0 additions & 6 deletions src/rotation_generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ Base.:-(r1::RotationGenerator, r2::RotationGenerator) = r1 + (-r2)
# `convert` goes through the constructors, similar to e.g. `Number`
Base.convert(::Type{R}, rot::RotationGenerator{N}) where {N,R<:RotationGenerator{N}} = R(rot)

# RotationGenerator matrices should be skew-symmetric. Only the operations we define,
# like addition, will stay as RotationGenerators, otherwise users will get an
# SMatrix{3,3} (e.g. rot1 * rot2 -> SMatrix)
Base.@pure StaticArrays.similar_type(::Union{R,Type{R}}) where {R <: RotationGenerator} = SMatrix{size(R)..., eltype(R), prod(size(R))}
Base.@pure StaticArrays.similar_type(::Union{R,Type{R}}, ::Type{T}) where {R <: RotationGenerator, T} = SMatrix{size(R)..., T, prod(size(R))}

################################################################################
################################################################################
"""
Expand Down
Loading