Skip to main content

Orbit

Struct Orbit 

Source
pub struct Orbit<S, T: TimeScale, O: Origin, R: ReferenceFrame> { /* private fields */ }
Expand description

An orbital state parameterized by state representation, time scale, origin, and reference frame.

Implementations§

Source§

impl<T, O, R> Orbit<Cartesian, T, O, R>
where T: TimeScale, O: Origin, R: ReferenceFrame,

Source

pub const fn new( cartesian: Cartesian, time: Time<T>, origin: O, frame: R, ) -> Self

Constructs a new Cartesian orbit from position/velocity state, epoch, origin, and frame.

Source

pub fn position(&self) -> DVec3

Returns the position vector in meters.

Source

pub fn velocity(&self) -> DVec3

Returns the velocity vector in meters per second.

Source

pub fn to_keplerian(&self) -> KeplerianOrbit<T, O, R>
where T: Copy, O: Copy + PointMass, R: Copy,

Converts this Cartesian orbit to Keplerian elements.

Source

pub fn try_to_keplerian( &self, ) -> Result<KeplerianOrbit<T, O, R>, UndefinedOriginPropertyError>
where T: Copy, O: Copy + TryPointMass, R: Copy,

Converts this Cartesian orbit to Keplerian elements, returning an error if the gravitational parameter is undefined.

Source

pub fn try_to_frame<R1, P>( &self, frame: R1, provider: &P, ) -> Result<CartesianOrbit<T, O, R1>, P::Error>
where R: Copy, P: TryRotation<R, R1, T>, R1: ReferenceFrame + Copy, O: Copy, T: Copy,

Transforms this orbit into a different reference frame using the given rotation provider.

Source§

impl<T, O> Orbit<Cartesian, T, O, Iau<O>>

Source

pub fn to_ground_location( &self, ) -> Result<GroundLocation<O>, FromBodyFixedError>

Converts this body-fixed Cartesian orbit to a ground location.

Source§

impl<T, O> Orbit<Cartesian, T, O, Icrf>
where T: TimeScale, O: Origin,

Source

pub fn rotation_lvlh(&self) -> DMat3

Returns the rotation matrix from ICRF to the Local Vertical Local Horizontal (LVLH) frame.

Source§

impl<T, O> Orbit<Cartesian, T, O, Icrf>
where T: TimeScale + Copy, O: Origin + Copy,

Source

pub fn to_origin<O1: Origin + Copy, E: Ephemeris>( &self, target: O1, ephemeris: &E, ) -> Result<CartesianOrbit<T, O1, Icrf>, E::Error>

Transforms this orbit to a different central body origin using an ephemeris.

Source§

impl Orbit<Cartesian, DynTimeScale, DynOrigin, DynFrame>

Source

pub fn try_to_origin<E: Ephemeris>( &self, target: DynOrigin, ephemeris: &E, ) -> Result<DynCartesianOrbit, E::Error>

Transforms this dynamic orbit to a different central body origin using an ephemeris.

Source

pub fn try_to_ground_location( &self, ) -> Result<DynGroundLocation, StateToDynGroundError>

Converts this dynamic Cartesian orbit to a ground location.

Source

pub fn try_rotation_lvlh(&self) -> Result<DMat3, &'static str>

Returns the LVLH rotation matrix, returning an error if the frame is not ICRF.

Source§

impl<T, O, R> Orbit<Keplerian, T, O, R>
where T: TimeScale, O: Origin, R: ReferenceFrame,

Source

pub const fn new( keplerian: Keplerian, time: Time<T>, origin: O, frame: R, ) -> Self
where R: QuasiInertial,

Constructs a new Keplerian orbit in a quasi-inertial frame.

Source

pub fn try_from_keplerian( keplerian: Keplerian, time: Time<T>, origin: O, frame: R, ) -> Result<Self, KeplerianOrbitError>

Constructs a Keplerian orbit with validation of the frame and perigee radius.

Source

pub fn semi_major_axis(&self) -> Distance

Returns the semi-major axis.

Source

pub fn eccentricity(&self) -> Eccentricity

Returns the eccentricity.

Source

pub fn inclination(&self) -> Inclination

Returns the inclination.

Source

pub fn longitude_of_ascending_node(&self) -> LongitudeOfAscendingNode

Returns the longitude of the ascending node.

Source

pub fn argument_of_periapsis(&self) -> ArgumentOfPeriapsis

Returns the argument of periapsis.

Source

pub fn true_anomaly(&self) -> TrueAnomaly

Returns the true anomaly.

Source

pub fn to_cartesian(&self) -> CartesianOrbit<T, O, R>
where T: Copy, O: Copy + PointMass, R: Copy,

Converts this Keplerian orbit to Cartesian position and velocity.

Source

pub fn try_to_cartesian( &self, ) -> Result<CartesianOrbit<T, O, R>, UndefinedOriginPropertyError>
where T: Copy, O: Copy + TryPointMass, R: Copy,

Converts this Keplerian orbit to Cartesian, returning an error if the gravitational parameter is undefined.

Source

pub fn orbital_period(&self) -> Option<TimeDelta>
where O: TryPointMass,

Returns the orbital period, or None for non-elliptical orbits or undefined gravitational parameters.

Source

pub fn trace(&self, n: usize) -> Option<Trajectory<T, O, R>>
where T: Copy, O: TryPointMass + Copy, R: Copy,

Generates a trajectory by tracing the full orbit with n evenly-spaced samples.

Source§

impl<S, T, O, R> Orbit<S, T, O, R>
where T: TimeScale, O: Origin, R: ReferenceFrame,

Source

pub const fn from_state(state: S, time: Time<T>, origin: O, frame: R) -> Self

Constructs an orbit from its state, epoch, origin, and reference frame.

Source

pub fn state(&self) -> S
where S: Copy,

Returns the orbital state.

Source

pub fn time(&self) -> Time<T>
where T: Copy,

Returns the epoch of this orbit.

Source

pub fn origin(&self) -> O
where O: Copy,

Returns the central body origin.

Source

pub fn reference_frame(&self) -> R
where R: Copy,

Returns the reference frame.

Source

pub fn try_gravitational_parameter( &self, ) -> Result<GravitationalParameter, UndefinedOriginPropertyError>
where O: TryPointMass,

Returns the gravitational parameter of the origin, or an error if undefined.

Source

pub fn gravitational_parameter(&self) -> GravitationalParameter
where O: PointMass,

Returns the gravitational parameter of the origin.

Source§

impl<S, T, O, R> Orbit<S, T, O, R>

Source

pub fn into_dyn(self) -> Orbit<S, DynTimeScale, DynOrigin, DynFrame>

Converts this orbit into a dynamically-typed orbit.

Trait Implementations§

Source§

impl<S: Clone, T: Clone + TimeScale, O: Clone + Origin, R: Clone + ReferenceFrame> Clone for Orbit<S, T, O, R>

Source§

fn clone(&self) -> Orbit<S, T, O, R>

Returns a duplicate 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<S: Debug, T: Debug + TimeScale, O: Debug + Origin, R: Debug + ReferenceFrame> Debug for Orbit<S, T, O, R>

Source§

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

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

impl<T, O, R> From<Orbit<Cartesian, T, O, R>> for CartesianState
where T: TimeScale, O: Origin, R: ReferenceFrame,

Source§

fn from(orbit: CartesianOrbit<T, O, R>) -> Self

Converts to this type from the input type.
Source§

impl<T, O, R> FromIterator<Orbit<Cartesian, T, O, R>> for Trajectory<T, O, R>
where T: TimeScale + Copy, O: Origin + Copy, R: ReferenceFrame + Copy,

Source§

fn from_iter<U: IntoIterator<Item = CartesianOrbit<T, O, R>>>(iter: U) -> Self

Creates a value from an iterator. Read more
Source§

impl<S: PartialEq, T: PartialEq + TimeScale, O: PartialEq + Origin, R: PartialEq + ReferenceFrame> PartialEq for Orbit<S, T, O, R>

Source§

fn eq(&self, other: &Orbit<S, T, O, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: Copy, T: Copy + TimeScale, O: Copy + Origin, R: Copy + ReferenceFrame> Copy for Orbit<S, T, O, R>

Source§

impl<S, T: TimeScale, O: Origin, R: ReferenceFrame> StructuralPartialEq for Orbit<S, T, O, R>

Auto Trait Implementations§

§

impl<S, T, O, R> Freeze for Orbit<S, T, O, R>
where S: Freeze, O: Freeze, R: Freeze, T: Freeze,

§

impl<S, T, O, R> RefUnwindSafe for Orbit<S, T, O, R>

§

impl<S, T, O, R> Send for Orbit<S, T, O, R>
where S: Send, O: Send, R: Send, T: Send,

§

impl<S, T, O, R> Sync for Orbit<S, T, O, R>
where S: Sync, O: Sync, R: Sync, T: Sync,

§

impl<S, T, O, R> Unpin for Orbit<S, T, O, R>
where S: Unpin, O: Unpin, R: Unpin, T: Unpin,

§

impl<S, T, O, R> UnsafeUnpin for Orbit<S, T, O, R>

§

impl<S, T, O, R> UnwindSafe for Orbit<S, T, O, R>

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,