Tudat/Astrodynamics/BasicAstrodynamics/unifiedStateModelModifiedRodriguesParameterElementConversions.cpp
Eigen::Vector7d convertCartesianToUnifiedStateModelModifiedRodriguesParameterElements(
        const Eigen::Vector6d& cartesianElements,
        const double centralBodyGravitationalParameter )
{
    // Declaring eventual output vector.
    Eigen::Vector7d convertedUnifiedStateModelModifiedRodriguesParameterElements = Eigen::Vector7d::Zero( );

    // Convert Cartesian to USM7
    Eigen::Vector7d unifiedStateModelQuaternionElements =
            convertCartesianToUnifiedStateModelQuaternionsElements( cartesianElements,
                                                                    centralBodyGravitationalParameter );

    // Convert quaternions to modified Rodrigues parameters
    convertedUnifiedStateModelModifiedRodriguesParameterElements.segment( sigma1USM6Index, 4 ) =
            convertQuaternionsToModifiedRodriguesParameterElements( unifiedStateModelQuaternionElements.segment( etaUSM7Index, 4 ) );

    // Add elements to USM6 vector
    convertedUnifiedStateModelModifiedRodriguesParameterElements.segment( CHodographUSM6Index, 3 ) =
            unifiedStateModelQuaternionElements.segment( CHodographUSM7Index, 3 );

    // Give back result
    return convertedUnifiedStateModelModifiedRodriguesParameterElements;
}
////! Convert Cartesian elements to unified state model elements with modified Rodrigues parameters.
Convert Cartesian elements to unified state model elements with modified Rodrigues parameters.
Convert Cartesian elements to unified state model elements with modified Rodrigues parameters .
Eigen::Vector7d convertCartesianToUnifiedStateModelModifiedRodriguesParameterElements(
        const Eigen::Vector6d& cartesianElements,
        const double centralBodyGravitationalParameter )
{
    Eigen::Vector7d convertedUnifiedStateModelModifiedRodriguesParameterElements = Eigen::Vector7d::Zero( );
    Eigen::Vector7d unifiedStateModelQuaternionElements =
            convertCartesianToUnifiedStateModelQuaternionsElements( cartesianElements,
                                                                    centralBodyGravitationalParameter );
    convertedUnifiedStateModelModifiedRodriguesParameterElements.segment( sigma1USM6Index, 4 ) =
            convertQuaternionsToModifiedRodriguesParameterElements( unifiedStateModelQuaternionElements.segment( etaUSM7Index, 4 ) );
    convertedUnifiedStateModelModifiedRodriguesParameterElements.segment( CHodographUSM6Index, 3 ) =
            unifiedStateModelQuaternionElements.segment( CHodographUSM7Index, 3 );
    return convertedUnifiedStateModelModifiedRodriguesParameterElements;
}
Eigen :: Vector7d convertCartesianToUnifiedStateModelModifiedRodriguesParameterElements ( const Eigen :: Vector6d & cartesianElements , const double centralBodyGravitationalParameter ) { Eigen :: Vector7d convertedUnifiedStateModelModifiedRodriguesParameterElements = Eigen :: Vector7d :: Zero ( ) ; Eigen :: Vector7d unifiedStateModelQuaternionElements = convertCartesianToUnifiedStateModelQuaternionsElements ( cartesianElements , centralBodyGravitationalParameter ) ; convertedUnifiedStateModelModifiedRodriguesParameterElements . segment ( sigma1USM6Index , 4 ) = convertQuaternionsToModifiedRodriguesParameterElements ( unifiedStateModelQuaternionElements . segment ( etaUSM7Index , 4 ) ) ; convertedUnifiedStateModelModifiedRodriguesParameterElements . segment ( CHodographUSM6Index , 3 ) = unifiedStateModelQuaternionElements . segment ( CHodographUSM7Index , 3 ) ; return convertedUnifiedStateModelModifiedRodriguesParameterElements ; }
Convert Cartesian elements to unified state model elements with modified Rodrigues parameters.
Convert Cartesian elements to unified state model elements with modified Rodrigues parameters .
// Declaring eventual output vector. // Convert Cartesian to USM7 // Convert quaternions to modified Rodrigues parameters // Add elements to USM6 vector // Give back result