[][src]Struct nyx_space::celestia::State

pub struct State {
    pub x: f64,
    pub y: f64,
    pub z: f64,
    pub vx: f64,
    pub vy: f64,
    pub vz: f64,
    pub dt: Epoch,
    pub frame: Frame,
}

State defines an orbital state parameterized by a CelestialBody.

Unless noted otherwise, algorithms are from GMAT 2016a StateConversionUtil.cpp. Regardless of the constructor used, this struct stores all the state information in Cartesian coordinates as these are always non singular. Note: although not yet supported, this struct may change once True of Date or other nutation frames are added to the toolkit.

Fields

x: f64

in km

y: f64

in km

z: f64

in km

vx: f64

in km/s

vy: f64

in km/s

vz: f64

in km/s

dt: Epochframe: Frame

Frame contains everything we need to compute state information

Methods

impl State[src]

pub fn cartesian(
    x: f64,
    y: f64,
    z: f64,
    vx: f64,
    vy: f64,
    vz: f64,
    dt: Epoch,
    frame: Frame
) -> Self
[src]

Creates a new State in the provided frame at the provided Epoch.

Units: km, km, km, km/s, km/s, km/s

pub fn from_position(x: f64, y: f64, z: f64, dt: Epoch, frame: Frame) -> Self[src]

Creates a new State in the provided frame at the provided Epoch in time with 0.0 velocity.

Units: km, km, km

pub fn cartesian_vec(state: &Vector6<f64>, dt: Epoch, frame: Frame) -> Self[src]

Creates a new State around in the provided frame from the borrowed state vector

The state vector must be x, y, z, vx, vy, vz. This function is a shortcut to cartesian and as such it has the same unit requirements.

pub fn rmag(&self) -> f64[src]

Returns the magnitude of the radius vector in km

pub fn vmag(&self) -> f64[src]

Returns the magnitude of the velocity vector in km/s

pub fn radius(&self) -> Vector3<f64>[src]

Returns the radius vector of this State in [km, km, km]

pub fn velocity(&self) -> Vector3<f64>[src]

Returns the radius vector of this State in [km, km, km]

pub fn to_cartesian_vec(&self) -> Vector6<f64>[src]

Returns this state as a Cartesian Vector6 in [km, km, km, km/s, km/s, km/s]

Note that the time is not returned in the vector.

pub fn distance_to(&self, other: &State) -> f64[src]

Returns the distancein kilometers between this state and another state. Will panic is the frames are different

pub fn distance_to_point(&self, other: &Vector3<f64>) -> f64[src]

Returns the distance in kilometers between this state and a point assumed to be in the same frame.

pub fn to_exb_state(&self) -> XBState[src]

pub fn r_hat(&self) -> Vector3<f64>[src]

Returns the unit vector in the direction of the state radius

pub fn v_hat(&self) -> Vector3<f64>[src]

Returns the unit vector in the direction of the state velocity

pub fn keplerian(
    sma: f64,
    ecc: f64,
    inc: f64,
    raan: f64,
    aop: f64,
    ta: f64,
    dt: Epoch,
    frame: Frame
) -> Self
[src]

Creates a new State around the provided Celestial or Geoid frame from the Keplerian orbital elements.

Units: km, none, degrees, degrees, degrees, degrees

WARNING: This function will panic if the singularities in the conversion are expected. NOTE: The state is defined in Cartesian coordinates as they are non-singular. This causes rounding errors when creating a state from its Keplerian orbital elements (cf. the state tests). One should expect these errors to be on the order of 1e-12.

pub fn keplerian_vec(state: &Vector6<f64>, dt: Epoch, frame: Frame) -> Self[src]

Creates a new State around the provided CelestialBody from the borrowed state vector

The state vector must be sma, ecc, inc, raan, aop, ta. This function is a shortcut to cartesian and as such it has the same unit requirements.

pub fn from_geodesic(
    latitude: f64,
    longitude: f64,
    height: f64,
    dt: Epoch,
    frame: Frame
) -> Self
[src]

Creates a new State from the geodetic latitude (φ), longitude (λ) and height with respect to Earth's ellipsoid.

Units: degrees, degrees, km NOTE: This computation differs from the spherical coordinates because we consider the flattening of Earth. Reference: G. Xu and Y. Xu, "GPS", DOI 10.1007/978-3-662-50367-6_2, 2016

pub fn to_keplerian_vec(&self) -> Vector6<f64>[src]

Returns this state as a Keplerian Vector6 in [km, none, degrees, degrees, degrees, degrees]

Note that the time is not returned in the vector.

pub fn hvec(&self) -> Vector3<f64>[src]

Returns the orbital momentum vector

pub fn hx(&self) -> f64[src]

Returns the orbital momentum value on the X axis

pub fn hy(&self) -> f64[src]

Returns the orbital momentum value on the Y axis

pub fn hz(&self) -> f64[src]

Returns the orbital momentum value on the Z axis

pub fn hmag(&self) -> f64[src]

Returns the norm of the orbital momentum

pub fn energy(&self) -> f64[src]

Returns the specific mechanical energy

pub fn sma(&self) -> f64[src]

Returns the semi-major axis in km

pub fn period(&self) -> f64[src]

Returns the period in seconds

pub fn evec(&self) -> Vector3<f64>[src]

Returns the eccentricity vector (no unit)

pub fn ecc(&self) -> f64[src]

Returns the eccentricity (no unit)

pub fn inc(&self) -> f64[src]

Returns the inclination in degrees

pub fn aop(&self) -> f64[src]

Returns the argument of periapsis in degrees

pub fn raan(&self) -> f64[src]

Returns the right ascension of ther ascending node in degrees

pub fn ta(&self) -> f64[src]

Returns the true anomaly in degrees between 0 and 360.0

NOTE: This function will emit a warning stating that the TA should be avoided if in a very near circular orbit Code from https://github.com/ChristopherRabotin/GMAT/blob/80bde040e12946a61dae90d9fc3538f16df34190/src/gmatutil/util/StateConversionUtil.cpp#L6835

pub fn tlong(&self) -> f64[src]

Returns the true longitude in degrees

pub fn aol(&self) -> f64[src]

Returns the argument of latitude in degrees

NOTE: If the orbit is near circular, the AoL will be computed from the true longitude instead of relying on the ill-defined true anomaly.

pub fn periapsis(&self) -> f64[src]

Returns the radius of periapsis (or perigee around Earth), in kilometers.

pub fn apoapsis(&self) -> f64[src]

Returns the radius of apoapsis (or apogee around Earth), in kilometers.

pub fn ea(&self) -> f64[src]

Returns the eccentric anomaly in degrees

This is a conversion from GMAT's StateConversionUtil::TrueToEccentricAnomaly

pub fn ma(&self) -> f64[src]

Returns the mean anomaly in degrees

This is a conversion from GMAT's StateConversionUtil::TrueToMeanAnomaly

pub fn semi_parameter(&self) -> f64[src]

Returns the semi parameter (or semilatus rectum)

pub fn is_brouwer_short_valid(&self) -> bool[src]

Returns whether this state satisfies the requirement to compute the Mean Brouwer Short orbital element set.

This is a conversion from GMAT's StateConversionUtil::CartesianToBrouwerMeanShort. The details are at the log level info. NOTE: Mean Brouwer Short are only defined around Earth. However, nyx does not check the main celestial body around which the state is defined (GMAT does perform this verification).

pub fn geodetic_longitude(&self) -> f64[src]

Returns the geodetic longitude (λ) in degrees. Value is between 0 and 360 degrees.

Although the reference is not Vallado, the math from Vallado proves to be equivalent. Reference: G. Xu and Y. Xu, "GPS", DOI 10.1007/978-3-662-50367-6_2, 2016

pub fn geodetic_latitude(&self) -> f64[src]

Returns the geodetic latitude (φ) in degrees. Value is between -180 and +180 degrees.

Reference: Vallado, 4th Ed., Algorithm 12 page 172.

pub fn geodetic_height(&self) -> f64[src]

Returns the geodetic height in km.

Reference: Vallado, 4th Ed., Algorithm 12 page 172.

pub fn dcm_to_inertial(&self, from: Frame) -> Matrix3<f64>[src]

Returns the direct cosine rotation matrix to convert to this inertial state.

pub fn apply_dcm(&mut self, dcm: Matrix3<f64>)[src]

Rotate this state provided a direct cosine matrix

Trait Implementations

impl<'_> Add<&'_ State> for &'_ State[src]

type Output = State

The resulting type after applying the + operator.

fn add(self, other: &State) -> State[src]

Add one state from another. Frame must be manually changed if needed.

impl Add<State> for State[src]

type Output = State

The resulting type after applying the + operator.

fn add(self, other: State) -> State[src]

Add one state from another. Frame must be manually changed if needed.

impl Clone for State[src]

impl Copy for State[src]

impl Debug for State[src]

impl Display for State[src]

impl<'a> Estimable<State> for CelestialDynamicsStm<'a>[src]

type LinStateSize = U6

Defines the state size of the estimated state

fn set_estimated_state(&mut self, new_state: VectorN<f64, Self::LinStateSize>)[src]

Returns the estimated state

impl LowerExp for State[src]

impl Neg for State[src]

type Output = State

The resulting type after applying the - operator.

fn neg(self) -> Self::Output[src]

Subtract one state from another

impl<'_> Neg for &'_ State[src]

type Output = State

The resulting type after applying the - operator.

fn neg(self) -> Self::Output[src]

Subtract one state from another

impl Octal for State[src]

impl PartialEq<State> for State[src]

fn eq(&self, other: &State) -> bool[src]

Two states are equal if their position are equal within one centimeter and their velocities within one centimeter per second.

impl Serialize for State[src]

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer
[src]

NOTE: This is not part of unit testing because there is no deseralization of State (yet)

impl<'_> Sub<&'_ State> for &'_ State[src]

type Output = State

The resulting type after applying the - operator.

fn sub(self, other: &State) -> State[src]

Subtract one state from another

impl Sub<State> for State[src]

type Output = State

The resulting type after applying the - operator.

fn sub(self, other: State) -> State[src]

Subtract one state from another

Auto Trait Implementations

impl RefUnwindSafe for State

impl Send for State

impl Sync for State

impl Unpin for State

impl UnwindSafe for State

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> ClosedNeg for T where
    T: Neg<Output = T>, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,