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

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

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: f64y: f64z: f64vx: f64vy: f64vz: f64dt: Epochframe: F

The frame will later allow for coordinate frame transformations.

Methods

impl<F> State<F> where
    F: Frame
[src]

pub fn from_cartesian<G>(
    x: f64,
    y: f64,
    z: f64,
    vx: f64,
    vy: f64,
    vz: f64,
    dt: Epoch,
    frame: G
) -> State<G> where
    G: Frame
[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<G>(x: f64, y: f64, z: f64, dt: Epoch, frame: G) -> State<G> where
    G: Frame
[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 from_cartesian_vec(state: &Vector6<f64>, dt: Epoch, frame: F) -> State<F> where
    F: Frame
[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 from_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.

impl State<Geoid>[src]

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

Creates a new State around the provided CelestialBody 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 from_keplerian_vec(state: &Vector6<f64>, dt: Epoch, frame: Geoid) -> 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 from_cartesian and as such it has the same unit requirements.

pub fn from_geodesic(
    latitude: f64,
    longitude: f64,
    height: f64,
    dt: Epoch,
    frame: Geoid
) -> State<Geoid>
[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

NOTE: This function will emit a warning stating that the TA should be avoided if in a very near circular orbit

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: LocalFrame) -> Matrix3<f64>[src]

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

Trait Implementations

impl<F: Clone> Clone for State<F> where
    F: Frame
[src]

impl<F: Copy> Copy for State<F> where
    F: Frame
[src]

impl<F: Frame> PartialEq<State<F>> for State<F>[src]

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

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

impl<F> Display for State<F> where
    F: Frame
[src]

impl<F: Debug> Debug for State<F> where
    F: Frame
[src]

impl<F: Frame> Sub<State<F>> for State<F>[src]

type Output = State<F>

The resulting type after applying the - operator.

fn sub(self, other: State<F>) -> State<F> where
    F: Frame
[src]

Subtract one state from another

impl<F: Frame> Add<State<F>> for State<F>[src]

type Output = State<F>

The resulting type after applying the + operator.

fn add(self, other: State<F>) -> State<F> where
    F: Frame
[src]

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

impl<F: Frame> Neg for State<F>[src]

type Output = State<F>

The resulting type after applying the - operator.

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

Subtract one state from another

impl Octal for State<Geoid>[src]

impl<F> Serialize for State<F> where
    F: Frame
[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)

Auto Trait Implementations

impl<F> Send for State<F> where
    F: Send

impl<F> Sync for State<F> where
    F: Sync

impl<F> Unpin for State<F> where
    F: Unpin

impl<F> UnwindSafe for State<F> where
    F: UnwindSafe

impl<F> RefUnwindSafe for State<F> where
    F: RefUnwindSafe

Blanket Implementations

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

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

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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