View Source SpaceDust.State.ECEFState (Space Dust v0.3.0)

State vector in Earth-Centered Earth-Fixed (ECEF) reference frame.

ECEF is a rotating reference frame fixed to the Earth with:

  • Origin at Earth's center of mass
  • X-axis pointing toward the intersection of the prime meridian and equator
  • Z-axis pointing toward the North Pole
  • Y-axis completing the right-handed system (90° East longitude)

Position and velocity are in kilometers and kilometers/second respectively. Note: Velocity in ECEF includes the Earth's rotation.

Summary

Functions

Create an ECEF state from Nx tensors.

Create a new ECEF state from position and velocity tuples.

Convert ECEF position to geodetic coordinates (latitude, longitude, altitude). Uses WGS84 ellipsoid parameters.

Convert position and velocity to Nx tensors for numerical operations. Returns {position_tensor, velocity_tensor} as 1D tensors of shape {3}.

Types

t()

@type t() :: %SpaceDust.State.ECEFState{
  epoch: DateTime.t(),
  position: {float(), float(), float()},
  velocity: {float(), float(), float()}
}

Functions

from_tensors(epoch, pos_tensor, vel_tensor)

@spec from_tensors(DateTime.t(), Nx.Tensor.t(), Nx.Tensor.t()) :: t()

Create an ECEF state from Nx tensors.

new(epoch, position, velocity)

@spec new(DateTime.t(), {float(), float(), float()}, {float(), float(), float()}) ::
  t()

Create a new ECEF state from position and velocity tuples.

Parameters

  • epoch: UTC DateTime
  • position: {x, y, z} in kilometers
  • velocity: {vx, vy, vz} in km/s

to_geodetic(ecef_state)

@spec to_geodetic(t()) :: {float(), float(), float()}

Convert ECEF position to geodetic coordinates (latitude, longitude, altitude). Uses WGS84 ellipsoid parameters.

Returns {latitude_deg, longitude_deg, altitude_km}

to_tensors(ecef_state)

@spec to_tensors(t()) :: {Nx.Tensor.t(), Nx.Tensor.t()}

Convert position and velocity to Nx tensors for numerical operations. Returns {position_tensor, velocity_tensor} as 1D tensors of shape {3}.