nyx_space::cosmic

Struct OrbitDual

Source
pub struct OrbitDual {
    pub x: OHyperdual<f64, U7>,
    pub y: OHyperdual<f64, U7>,
    pub z: OHyperdual<f64, U7>,
    pub vx: OHyperdual<f64, U7>,
    pub vy: OHyperdual<f64, U7>,
    pub vz: OHyperdual<f64, U7>,
    pub dt: Epoch,
    pub frame: Frame,
}
Expand description

Orbit defines an orbital state

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: OHyperdual<f64, U7>

in km

§y: OHyperdual<f64, U7>

in km

§z: OHyperdual<f64, U7>

in km

§vx: OHyperdual<f64, U7>

in km/s

§vy: OHyperdual<f64, U7>

in km/s

§vz: OHyperdual<f64, U7>

in km/s

§dt: Epoch§frame: Frame

Frame contains everything we need to compute state information

Implementations§

Source§

impl OrbitDual

Source

pub fn partial_for( &self, param: StateParameter, ) -> Result<OrbitPartial, AstroError>

Source

pub fn rmag_km(&self) -> OrbitPartial

Returns the magnitude of the radius vector in km

Source

pub fn vmag_km_s(&self) -> OrbitPartial

Returns the magnitude of the velocity vector in km/s

Source

pub fn hx(&self) -> OrbitPartial

Returns the orbital momentum value on the X axis

Source

pub fn hy(&self) -> OrbitPartial

Returns the orbital momentum value on the Y axis

Source

pub fn hz(&self) -> OrbitPartial

Returns the orbital momentum value on the Z axis

Source

pub fn hmag(&self) -> OrbitPartial

Returns the norm of the orbital momentum

Source

pub fn energy_km2_s2(&self) -> PhysicsResult<OrbitPartial>

Returns the specific mechanical energy

Source

pub fn sma_km(&self) -> PhysicsResult<OrbitPartial>

Returns the semi-major axis in km

Source

pub fn ecc(&self) -> PhysicsResult<OrbitPartial>

Returns the eccentricity (no unit)

Source

pub fn inc_deg(&self) -> OrbitPartial

Returns the inclination in degrees

Source

pub fn aop_deg(&self) -> PhysicsResult<OrbitPartial>

Returns the argument of periapsis in degrees

Source

pub fn raan_deg(&self) -> OrbitPartial

Returns the right ascension of ther ascending node in degrees

Source

pub fn ta_deg(&self) -> PhysicsResult<OrbitPartial>

Returns the true anomaly in degrees between 0 and 360.0

Source

pub fn tlong_deg(&self) -> PhysicsResult<OrbitPartial>

Returns the true longitude in degrees

Source

pub fn aol_deg(&self) -> PhysicsResult<OrbitPartial>

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.

Source

pub fn periapsis_km(&self) -> PhysicsResult<OrbitPartial>

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

Source

pub fn apoapsis_km(&self) -> PhysicsResult<OrbitPartial>

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

Source

pub fn ea_deg(&self) -> PhysicsResult<OrbitPartial>

Returns the eccentric anomaly in degrees

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

Source

pub fn fpa_deg(&self) -> PhysicsResult<OrbitPartial>

Returns the flight path angle in degrees

Source

pub fn ma_deg(&self) -> PhysicsResult<OrbitPartial>

Returns the mean anomaly in degrees

Source

pub fn semi_parameter_km(&self) -> PhysicsResult<OrbitPartial>

Returns the semi parameter (or semilatus rectum)

Source

pub fn longitude_deg(&self) -> OrbitPartial

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

Source

pub fn latitude_deg(&self) -> PhysicsResult<OrbitPartial>

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

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

Source

pub fn height_km(&self) -> PhysicsResult<OrbitPartial>

Returns the geodetic height in km.

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

Source

pub fn right_ascension_deg(&self) -> OrbitPartial

Returns the right ascension of this orbit in degrees

Source

pub fn declination_deg(&self) -> OrbitPartial

Returns the declination of this orbit in degrees

Source

pub fn semi_minor_axis_km(&self) -> PhysicsResult<OrbitPartial>

Returns the semi minor axis in km, includes code for a hyperbolic orbit

Source

pub fn velocity_declination(&self) -> OrbitPartial

Returns the velocity declination of this orbit in degrees

Source

pub fn c3(&self) -> PhysicsResult<OrbitPartial>

Returns the $C_3$ of this orbit

Source

pub fn hyperbolic_anomaly_deg(&self) -> Result<OrbitPartial, AstroError>

Returns the hyperbolic anomaly in degrees between 0 and 360.0

Trait Implementations§

Source§

impl Clone for OrbitDual

Source§

fn clone(&self) -> OrbitDual

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OrbitDual

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<CartesianState> for OrbitDual

Source§

fn from(orbit: Orbit) -> Self

Initialize a new OrbitDual from an orbit, no other initializers

Source§

impl TimeTagged for OrbitDual

Source§

fn epoch(&self) -> Epoch

Retrieve the Epoch
Source§

fn set_epoch(&mut self, epoch: Epoch)

Set the Epoch
Source§

impl Copy for OrbitDual

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T