99Base. convert (:: Type{<:DCM} , a:: EulerAngles ) = angle_to_dcm (a)
1010Base. convert (:: Type{<:DCM} , a:: Quaternion ) = quat_to_dcm (a)
1111Base. convert (:: Type{<:DCM} , a:: EulerAngleAxis ) = angleaxis_to_dcm (a)
12+ Base. convert (:: Type{<:DCM} , a:: CRP ) = crp_to_dcm (a)
13+ Base. convert (:: Type{<:DCM} , a:: MRP ) = mrp_to_dcm (a)
1214
1315# == Conversion to Euler Angles ============================================================
1416
@@ -28,18 +30,48 @@ function Base.convert(::Type{<:_EulerAngleConversion{R}}, a::Quaternion) where R
2830 return quat_to_angle (a, R)
2931end
3032
33+ function Base. convert (:: Type{<:_EulerAngleConversion{R}} , a:: CRP ) where R
34+ return crp_to_angle (a, R)
35+ end
36+
37+ function Base. convert (:: Type{<:_EulerAngleConversion{R}} , a:: MRP ) where R
38+ return mrp_to_angle (a, R)
39+ end
40+
3141Base. convert (:: Type{<:EulerAngles} , a:: DCM ) = dcm_to_angle (a, :ZYX )
3242Base. convert (:: Type{<:EulerAngles} , a:: EulerAngleAxis ) = angleaxis_to_angle (a, :ZYX )
3343Base. convert (:: Type{<:EulerAngles} , a:: Quaternion ) = quat_to_angle (a, :ZYX )
44+ Base. convert (:: Type{<:EulerAngles} , a:: CRP ) = crp_to_angle (a, :ZYX )
45+ Base. convert (:: Type{<:EulerAngles} , a:: MRP ) = mrp_to_angle (a, :ZYX )
3446
3547# == Conversions to Euler Angle and Axis ===================================================
3648
3749Base. convert (:: Type{<:EulerAngleAxis} , a:: DCM ) = dcm_to_angleaxis (a)
3850Base. convert (:: Type{<:EulerAngleAxis} , a:: EulerAngles ) = angle_to_angleaxis (a)
3951Base. convert (:: Type{<:EulerAngleAxis} , a:: Quaternion ) = quat_to_angleaxis (a)
52+ Base. convert (:: Type{<:EulerAngleAxis} , a:: CRP ) = crp_to_angleaxis (a)
53+ Base. convert (:: Type{<:EulerAngleAxis} , a:: MRP ) = mrp_to_angleaxis (a)
4054
4155# == Conversions to Quaternions ============================================================
4256
4357Base. convert (:: Type{<:Quaternion} , a:: DCM ) = dcm_to_quat (a)
4458Base. convert (:: Type{<:Quaternion} , a:: EulerAngles ) = angle_to_quat (a)
4559Base. convert (:: Type{<:Quaternion} , a:: EulerAngleAxis ) = angleaxis_to_quat (a)
60+ Base. convert (:: Type{<:Quaternion} , a:: CRP ) = crp_to_quat (a)
61+ Base. convert (:: Type{<:Quaternion} , a:: MRP ) = mrp_to_quat (a)
62+
63+ # == Conversions to CRP ====================================================================
64+
65+ Base. convert (:: Type{<:CRP} , a:: DCM ) = dcm_to_crp (a)
66+ Base. convert (:: Type{<:CRP} , a:: Quaternion ) = quat_to_crp (a)
67+ Base. convert (:: Type{<:CRP} , a:: EulerAngles ) = dcm_to_crp (angle_to_dcm (a))
68+ Base. convert (:: Type{<:CRP} , a:: EulerAngleAxis ) = dcm_to_crp (angleaxis_to_dcm (a))
69+ Base. convert (:: Type{<:CRP} , a:: MRP ) = dcm_to_crp (mrp_to_dcm (a))
70+
71+ # == Conversions to MRP ====================================================================
72+
73+ Base. convert (:: Type{<:MRP} , a:: DCM ) = dcm_to_mrp (a)
74+ Base. convert (:: Type{<:MRP} , a:: Quaternion ) = quat_to_mrp (a)
75+ Base. convert (:: Type{<:MRP} , a:: EulerAngles ) = dcm_to_mrp (angle_to_dcm (a))
76+ Base. convert (:: Type{<:MRP} , a:: EulerAngleAxis ) = dcm_to_mrp (angleaxis_to_dcm (a))
77+ Base. convert (:: Type{<:MRP} , a:: CRP ) = dcm_to_mrp (crp_to_dcm (a))
0 commit comments