Skip to content

NTW Frame

rotation_ntw_to_eci builtin

rotation_ntw_to_eci(x_eci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Computes the rotation matrix transforming a vector in the Normal, Tangential, Cross-track (NTW) frame to the Earth-Centered Inertial (ECI) frame.

The ECI frame can be any inertial frame centered on the orbited body, such as GCRF or EME2000.

The NTW frame follows the SANA definition: - Y (T): Unit vector along the inertial velocity. - Z (W): Unit vector along the orbital angular momentum r x v. - X (N): Y x Z, completing the right-handed set; in the orbit plane, normal to the velocity, pointing outward (radial for a circular orbit).

On a circular orbit NTW coincides with RTN; on an eccentric orbit the two differ by the flight-path angle. TNW and VNC use the same three directions reordered with a sign change: TNW = [Y_NTW, -X_NTW, Z_NTW] and VNC = [Y_NTW, Z_NTW, X_NTW].

Parameters:

Name Type Description Default
x_eci ndarray or list

6D state vector in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming from NTW to ECI frame, shape (3, 3), or the batch dimensions followed by (3, 3) for batched input.

Example
import brahe as bh
import numpy as np

# Define satellite state
sma = bh.R_EARTH + 700e3  # Semi-major axis in meters
state = np.array([sma, 0.0, 0.0, 0.0, bh.perigee_velocity(sma, 0.0), 0.0])

# Get rotation matrix
R = bh.rotation_ntw_to_eci(state)
print(f"NTW to ECI rotation matrix:\n{R}")

rotation_eci_to_ntw builtin

rotation_eci_to_ntw(x_eci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Computes the rotation matrix transforming a vector in the Earth-Centered Inertial (ECI) frame to the Normal, Tangential, Cross-track (NTW) frame.

This is the transpose (inverse) of the NTW-to-ECI rotation matrix.

Parameters:

Name Type Description Default
x_eci ndarray or list

6D state vector in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 3x3 rotation matrix transforming from ECI to NTW frame, shape (3, 3), or the batch dimensions followed by (3, 3) for batched input.

Example
1
2
3
4
5
6
7
8
import brahe as bh
import numpy as np

oe = np.array([bh.R_EARTH + 700e3, 0.01, 97.8, 15.0, 30.0, 45.0])
x_eci = bh.state_koe_to_eci(oe, bh.AngleFormat.DEGREES)

R = bh.rotation_eci_to_ntw(x_eci)
print(f"ECI to NTW rotation matrix:\n{R}")

omega_ntw builtin

omega_ntw(x_eci: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Computes the angular velocity of the Normal, Tangential, Cross-track (NTW) frame with respect to the Earth-Centered Inertial (ECI) frame, expressed in NTW axes. Equal to omega_ntw_for_body with GM_EARTH.

The NTW axes are built from the velocity direction and the orbit normal, so the frame turns with the velocity vector: about the W axis at omega_v = mu * |h| / (r^3 * v^2), the two-body rate at which the unit velocity rotates. The rate is exact under two-body motion and is the rate of the osculating frame otherwise. On a circular orbit it equals the mean motion.

Parameters:

Name Type Description Default
x_eci ndarray or list

6D state vector in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0.

-1

Returns:

Type Description
ndarray

numpy.ndarray: Angular velocity of the NTW frame relative to ECI, expressed in NTW axes (rad/s), shape (3,), or the batch dimensions with 3 components along axis for batched input.

Example
1
2
3
4
5
6
import brahe as bh
import numpy as np

oe = np.array([bh.R_EARTH + 700e3, 0.01, 97.8, 15.0, 30.0, 45.0])
x_eci = bh.state_koe_to_eci(oe, bh.AngleFormat.DEGREES)
omega = bh.omega_ntw(x_eci)

omega_ntw_for_body builtin

omega_ntw_for_body(x_inertial: Union[ndarray, Sequence], gm: float, axis: int = -1) -> ndarray

Computes the angular velocity of the Normal, Tangential, Cross-track (NTW) frame with respect to an inertial frame centered on a body with gravitational parameter gm, expressed in NTW axes.

Parameters:

Name Type Description Default
x_inertial ndarray or list

6D state vector in the inertial frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
gm float

Gravitational parameter of the central body (m^3/s^2)

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0.

-1

Returns:

Type Description
ndarray

numpy.ndarray: Angular velocity of the NTW frame relative to the inertial frame, expressed in NTW axes (rad/s), shape (3,), or the batch dimensions with 3 components along axis for batched input.

Example
1
2
3
4
5
6
import brahe as bh
import numpy as np

sma = bh.R_MARS + 400e3
x = np.array([sma, 0.0, 0.0, 0.0, np.sqrt(bh.GM_MARS / sma), 0.0])
omega = bh.omega_ntw_for_body(x, bh.GM_MARS)

state_eci_to_ntw builtin

state_eci_to_ntw(x_chief: Union[ndarray, Sequence], x_deputy: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms the absolute states of a chief and deputy satellite from the Earth-Centered Inertial (ECI) frame to the relative state of the deputy with respect to the chief in the rotating Normal, Tangential, Cross-track (NTW) frame.

Parameters:

Name Type Description Default
x_chief ndarray or list

6D state vector of the chief satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
x_deputy ndarray or list

6D state vector of the deputy satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0. A single vector in one argument is broadcast across a batch in the other.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 6D relative state of the deputy with respect to the chief in the NTW frame [rho_N, rho_T, rho_W, rho_dot_N, rho_dot_T, rho_dot_W] (m, m/s), shape (6,), or the layout of the batched argument for batched input.

Example
import brahe as bh
import numpy as np

bh.initialize_eop()

oe_chief = np.array([bh.R_EARTH + 700e3, 0.01, 97.8, 15.0, 30.0, 45.0])
oe_deputy = np.array([bh.R_EARTH + 701e3, 0.0115, 97.85, 15.05, 30.05, 45.05])

x_chief = bh.state_koe_to_eci(oe_chief, bh.AngleFormat.DEGREES)
x_deputy = bh.state_koe_to_eci(oe_deputy, bh.AngleFormat.DEGREES)

x_rel_ntw = bh.state_eci_to_ntw(x_chief, x_deputy)
print(f"Relative state in NTW: {x_rel_ntw}")

state_inertial_to_ntw_for_body builtin

state_inertial_to_ntw_for_body(x_chief: Union[ndarray, Sequence], x_deputy: Union[ndarray, Sequence], gm: float, axis: int = -1) -> ndarray

Transforms the absolute states of a chief and deputy satellite from an inertial frame centered on a body with gravitational parameter gm to the relative state of the deputy with respect to the chief in the rotating Normal, Tangential, Cross-track (NTW) frame.

Parameters:

Name Type Description Default
x_chief ndarray or list

6D state vector of the chief satellite in the inertial frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
x_deputy ndarray or list

6D state vector of the deputy satellite in the inertial frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
gm float

Gravitational parameter of the central body (m^3/s^2)

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0. A single vector in one argument is broadcast across a batch in the other.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 6D relative state of the deputy with respect to the chief in the NTW frame [rho_N, rho_T, rho_W, rho_dot_N, rho_dot_T, rho_dot_W] (m, m/s), shape (6,), or the layout of the batched argument for batched input.

Example
import brahe as bh
import numpy as np

oe_chief = np.array([bh.R_MARS + 400e3, 0.05, 92.6, 45.0, 270.0, 10.0])
oe_deputy = np.array([bh.R_MARS + 401e3, 0.0515, 92.65, 45.05, 270.05, 10.05])

x_chief = bh.state_koe_to_inertial_for_body(oe_chief, bh.CentralBody.Mars, bh.AngleFormat.DEGREES)
x_deputy = bh.state_koe_to_inertial_for_body(oe_deputy, bh.CentralBody.Mars, bh.AngleFormat.DEGREES)

x_rel_ntw = bh.state_inertial_to_ntw_for_body(x_chief, x_deputy, bh.GM_MARS)

state_ntw_to_eci builtin

state_ntw_to_eci(x_chief: Union[ndarray, Sequence], x_rel_ntw: Union[ndarray, Sequence], axis: int = -1) -> ndarray

Transforms the relative state of a deputy satellite with respect to a chief satellite from the rotating Normal, Tangential, Cross-track (NTW) frame to the absolute state of the deputy in the Earth-Centered Inertial (ECI) frame.

Parameters:

Name Type Description Default
x_chief ndarray or list

6D state vector of the chief satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
x_rel_ntw ndarray or list

6D relative state of the deputy with respect to the chief in the NTW frame [rho_N, rho_T, rho_W, rho_dot_N, rho_dot_T, rho_dot_W] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0. A single vector in one argument is broadcast across a batch in the other.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 6D state vector of the deputy satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or the layout of the batched argument for batched input.

Example
import brahe as bh
import numpy as np

bh.initialize_eop()

oe_chief = np.array([bh.R_EARTH + 700e3, 0.01, 97.8, 15.0, 30.0, 45.0])
x_chief = bh.state_koe_to_eci(oe_chief, bh.AngleFormat.DEGREES)

# Relative state: 1km X, 0.5km Y, -0.3km Z
x_rel_ntw = np.array([1000.0, 500.0, -300.0, 0.0, 0.0, 0.0])

x_deputy = bh.state_ntw_to_eci(x_chief, x_rel_ntw)
print(f"Deputy state in ECI: {x_deputy}")

state_ntw_to_inertial_for_body builtin

state_ntw_to_inertial_for_body(x_chief: Union[ndarray, Sequence], x_rel_ntw: Union[ndarray, Sequence], gm: float, axis: int = -1) -> ndarray

Transforms the relative state of a deputy satellite with respect to a chief satellite from the rotating Normal, Tangential, Cross-track (NTW) frame to the absolute state of the deputy in an inertial frame centered on a body with gravitational parameter gm.

Parameters:

Name Type Description Default
x_chief ndarray or list

6D state vector of the chief satellite in the inertial frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
x_rel_ntw ndarray or list

6D relative state of the deputy with respect to the chief in the NTW frame [rho_N, rho_T, rho_W, rho_dot_N, rho_dot_T, rho_dot_W] (m, m/s), shape (6,), or a batch of vectors with the 6 components along axis (for example shape (n, 6)).

required
gm float

Gravitational parameter of the central body (m^3/s^2)

required
axis int

The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default -1 applies; a (6, n) column layout uses axis=0. A single vector in one argument is broadcast across a batch in the other.

-1

Returns:

Type Description
ndarray

numpy.ndarray: 6D state vector of the deputy satellite in the inertial frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or the layout of the batched argument for batched input.

Example
1
2
3
4
5
6
7
8
import brahe as bh
import numpy as np

oe_chief = np.array([bh.R_MARS + 400e3, 0.05, 92.6, 45.0, 270.0, 10.0])
x_chief = bh.state_koe_to_inertial_for_body(oe_chief, bh.CentralBody.Mars, bh.AngleFormat.DEGREES)
x_rel_ntw = np.array([1000.0, 500.0, -300.0, 0.0, 0.0, 0.0])

x_deputy = bh.state_ntw_to_inertial_for_body(x_chief, x_rel_ntw, bh.GM_MARS)

See Also