Skip to content

Mars Frames

Transformations between Mars-Centered Inertial (MCI), Mars-Centered Mars-Fixed (MCMF), and Earth-Centered Inertial (ECI).

Note

For conceptual explanations and examples, including MCI's body-center origin and the mar099s kernel it uses, see Mars Reference Frames in the Learn section.

MCI ↔ MCMF

rotation_mci_to_mcmf builtin

rotation_mci_to_mcmf(epc: Epoch) -> ndarray

Computes the rotation matrix from Mars-Centered Inertial (MCI) to Mars-Centered Mars-Fixed (MCMF), using the IAU/WGCCRE pole and prime-meridian model for Mars.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation matrix

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming MCI -> MCMF

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_mci_to_mcmf(epc)

rotation_mcmf_to_mci builtin

rotation_mcmf_to_mci(epc: Epoch) -> ndarray

Computes the rotation matrix from Mars-Centered Mars-Fixed (MCMF) to Mars-Centered Inertial (MCI). Inverse of rotation_mci_to_mcmf.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation matrix

required

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming MCMF -> MCI

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
r = bh.rotation_mcmf_to_mci(epc)

position_mci_to_mcmf builtin

position_mci_to_mcmf(epc: Epoch, x_mci: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Mars-inertial (MCI) position into the equivalent Cartesian Mars-fixed (MCMF) position.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_mci ndarray or list

Cartesian MCI position (m), shape (3,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian MCMF position (m), shape (3,)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_mcmf = bh.position_mci_to_mcmf(epc, [bh.R_MARS + 400e3, 0.0, 0.0])

position_mcmf_to_mci builtin

position_mcmf_to_mci(epc: Epoch, x_mcmf: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Mars-fixed (MCMF) position into the equivalent Cartesian Mars-inertial (MCI) position.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_mcmf ndarray or list

Cartesian MCMF position (m), shape (3,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian MCI position (m), shape (3,)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_mci = bh.position_mcmf_to_mci(epc, [bh.R_MARS, 0.0, 0.0])

state_mci_to_mcmf builtin

state_mci_to_mcmf(epc: Epoch, x_mci: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Mars-inertial (MCI) state (position and velocity) into the equivalent Cartesian Mars-fixed (MCMF) state.

The velocity transformation accounts for the transport term induced by Mars' rotation.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_mci ndarray or list

Cartesian MCI state [position (m), velocity (m/s)], shape (6,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian MCMF state [position (m), velocity (m/s)], shape (6,)

Example
1
2
3
4
5
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_mci = [bh.R_MARS + 400e3, 0.0, 0.0, 0.0, 3.4e3, 0.0]
x_mcmf = bh.state_mci_to_mcmf(epc, x_mci)

state_mcmf_to_mci builtin

state_mcmf_to_mci(epc: Epoch, x_mcmf: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Mars-fixed (MCMF) state (position and velocity) into the equivalent Cartesian Mars-inertial (MCI) state. Inverse of state_mci_to_mcmf.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_mcmf ndarray or list

Cartesian MCMF state [position (m), velocity (m/s)], shape (6,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian MCI state [position (m), velocity (m/s)], shape (6,)

Example
1
2
3
4
5
6
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_mci = [bh.R_MARS + 400e3, 0.0, 0.0, 0.0, 3.4e3, 0.0]
x_mcmf = bh.state_mci_to_mcmf(epc, x_mci)
x_mci2 = bh.state_mcmf_to_mci(epc, x_mcmf)

ECI ↔ MCI

position_eci_to_mci builtin

position_eci_to_mci(epc: Epoch, x_eci: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Earth-inertial (ECI) position into the equivalent Cartesian Mars-inertial (MCI) position.

The MCI origin is the Mars body center (NAIF ID 499); the mar099s satellite ephemeris kernel is auto-loaded for the body-center leg. Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_eci ndarray or list

Cartesian ECI position (m), shape (3,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian MCI position (m), shape (3,)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_mci = bh.position_eci_to_mci(epc, [1e7, 2e7, 3e7])

position_mci_to_eci builtin

position_mci_to_eci(epc: Epoch, x_mci: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Mars-inertial (MCI) position into the equivalent Cartesian Earth-inertial (ECI) position.

The MCI origin is the Mars body center (NAIF ID 499); the mar099s satellite ephemeris kernel is auto-loaded for the body-center leg. Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_mci ndarray or list

Cartesian MCI position (m), shape (3,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian ECI position (m), shape (3,)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_eci = bh.position_mci_to_eci(epc, [1e7, 2e7, 3e7])

state_eci_to_mci builtin

state_eci_to_mci(epc: Epoch, x_eci: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Earth-inertial (ECI) state (position and velocity) into the equivalent Cartesian Mars-inertial (MCI) state.

The MCI origin is the Mars body center (NAIF ID 499); the mar099s satellite ephemeris kernel is auto-loaded for the body-center leg. Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_eci ndarray or list

Cartesian ECI state [position (m), velocity (m/s)], shape (6,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian MCI state [position (m), velocity (m/s)], shape (6,)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_mci = bh.state_eci_to_mci(epc, [1e7, 2e7, 3e7, 1.0, 2.0, 3.0])

state_mci_to_eci builtin

state_mci_to_eci(epc: Epoch, x_mci: Union[ndarray, List]) -> ndarray

Transforms a Cartesian Mars-inertial (MCI) state (position and velocity) into the equivalent Cartesian Earth-inertial (ECI) state.

The MCI origin is the Mars body center (NAIF ID 499); the mar099s satellite ephemeris kernel is auto-loaded for the body-center leg. Auto-initializes the default de440s ephemeris if no SPK kernel is loaded.

Parameters:

Name Type Description Default
epc Epoch

Epoch instant for computation of the transformation

required
x_mci ndarray or list

Cartesian MCI state [position (m), velocity (m/s)], shape (6,)

required

Returns:

Type Description
ndarray

numpy.ndarray: Cartesian ECI state [position (m), velocity (m/s)], shape (6,)

Example
1
2
3
4
import brahe as bh

epc = bh.Epoch.from_datetime(2024, 3, 1, 0, 0, 0.0, 0.0, bh.UTC)
x_eci = bh.state_mci_to_eci(epc, [1e7, 2e7, 3e7, 1.0, 2.0, 3.0])

See Also