Struct nyx_space::md::ui::Orbit [−][src]
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: 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: Epoch
frame: Frame
Frame contains everything we need to compute state information
stm: Option<Matrix6<f64>>
Optionally stores an STM
stm_kind: StmKind
Implementations
impl Orbit
[src]
pub fn cartesian(
x: f64,
y: f64,
z: f64,
vx: f64,
vy: f64,
vz: f64,
dt: Epoch,
frame: Frame
) -> Self
[src]
x: f64,
y: f64,
z: f64,
vx: f64,
vy: f64,
vz: f64,
dt: Epoch,
frame: Frame
) -> Self
Creates a new Orbit in the provided frame at the provided Epoch.
Units: km, km, km, km/s, km/s, km/s
pub fn cartesian_stm(
x: f64,
y: f64,
z: f64,
vx: f64,
vy: f64,
vz: f64,
dt: Epoch,
frame: Frame
) -> Self
[src]
x: f64,
y: f64,
z: f64,
vx: f64,
vy: f64,
vz: f64,
dt: Epoch,
frame: Frame
) -> Self
Creates a new Orbit and initializes its STM.
pub fn from_position(x: f64, y: f64, z: f64, dt: Epoch, frame: Frame) -> Self
[src]
Creates a new Orbit 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 Orbit 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 Orbit in [km, km, km]
pub fn velocity(&self) -> Vector3<f64>
[src]
Returns the radius vector of this Orbit 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: &Orbit) -> f64
[src]
Returns the distance in 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 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]
sma: f64,
ecc: f64,
inc: f64,
raan: f64,
aop: f64,
ta: f64,
dt: Epoch,
frame: Frame
) -> Self
Creates a new Orbit 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_alt(
sma_altitude: f64,
ecc: f64,
inc: f64,
raan: f64,
aop: f64,
ta: f64,
dt: Epoch,
frame: Frame
) -> Self
[src]
sma_altitude: f64,
ecc: f64,
inc: f64,
raan: f64,
aop: f64,
ta: f64,
dt: Epoch,
frame: Frame
) -> Self
Creates a new Orbit from the provided semi-major axis altitude in kilometers
pub fn keplerian_vec(state: &Vector6<f64>, dt: Epoch, frame: Frame) -> Self
[src]
Creates a new Orbit around the provided frame 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]
latitude: f64,
longitude: f64,
height: f64,
dt: Epoch,
frame: Frame
) -> Self
Creates a new Orbit from the geodetic latitude (φ), longitude (λ) and height with respect to the ellipsoid of the frame.
Units: degrees, degrees, km
NOTE: This computation differs from the spherical coordinates because we consider the flattening of body.
Reference: G. Xu and Y. Xu, “GPS”, DOI 10.1007/978-3-662-50367-6_2, 2016
WARNING: This uses the rotational rates known to Nyx. For other objects, use from_altlatlong
for other celestial bodies.
pub fn from_altlatlong(
latitude: f64,
longitude: f64,
height: f64,
angular_velocity: f64,
dt: Epoch,
frame: Frame
) -> Self
[src]
latitude: f64,
longitude: f64,
height: f64,
angular_velocity: f64,
dt: Epoch,
frame: Frame
) -> Self
Creates a new Orbit from the latitude (φ), longitude (λ) and height with respect to the frame’s ellipsoid.
Units: degrees, degrees, km, rad/s NOTE: This computation differs from the spherical coordinates because we consider the flattening of body. 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 set_sma(&mut self, new_sma_km: f64)
[src]
Mutates this orbit to change the SMA
pub fn with_sma(self, new_sma_km: f64) -> Self
[src]
Returns a copy of the state with a new SMA
pub fn add_sma(self, delta_sma: f64) -> Self
[src]
Returns a copy of the state with a provided SMA added to the current one
pub fn period(&self) -> Duration
[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 set_ecc(&mut self, new_ecc: f64)
[src]
Mutates this orbit to change the ECC
pub fn with_ecc(self, new_ecc: f64) -> Self
[src]
Returns a copy of the state with a new ECC
pub fn add_ecc(self, delta_ecc: f64) -> Self
[src]
Returns a copy of the state with a provided ECC added to the current one
pub fn inc(&self) -> f64
[src]
Returns the inclination in degrees
pub fn set_inc(&mut self, new_inc: f64)
[src]
Mutates this orbit to change the INC
pub fn with_inc(self, new_inc: f64) -> Self
[src]
Returns a copy of the state with a new INC
pub fn add_inc(self, delta_inc: f64) -> Self
[src]
Returns a copy of the state with a provided INC added to the current one
pub fn aop(&self) -> f64
[src]
Returns the argument of periapsis in degrees
pub fn set_aop(&mut self, new_aop: f64)
[src]
Mutates this orbit to change the AOP
pub fn with_aop(self, new_aop: f64) -> Self
[src]
Returns a copy of the state with a new AOP
pub fn add_aop(self, delta_aop: f64) -> Self
[src]
Returns a copy of the state with a provided AOP added to the current one
pub fn raan(&self) -> f64
[src]
Returns the right ascension of ther ascending node in degrees
pub fn set_raan(&mut self, new_raan: f64)
[src]
Mutates this orbit to change the RAAN
pub fn with_raan(self, new_raan: f64) -> Self
[src]
Returns a copy of the state with a new RAAN
pub fn add_raan(self, delta_raan: f64) -> Self
[src]
Returns a copy of the state with a provided RAAN added to the current one
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 set_ta(&mut self, new_ta: f64)
[src]
Mutates this orbit to change the TA
pub fn with_ta(self, new_ta: f64) -> Self
[src]
Returns a copy of the state with a new TA
pub fn add_ta(self, delta_ta: f64) -> Self
[src]
Returns a copy of the state with a provided TA added to the current one
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 fpa(&self) -> f64
[src]
Returns the flight path angle in degrees
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 right_ascension(&self) -> f64
[src]
Returns the right ascension of this orbit in degrees
pub fn declination(&self) -> f64
[src]
Returns the declination of this orbit in degrees
pub fn semi_minor_axis(&self) -> f64
[src]
Returns the semi minor axis in km
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
pub fn enable_stm(&mut self)
[src]
Sets the STM of this state of identity, which also enables computation of the STM for spacecraft navigation
pub fn enable_traj_stm(&mut self)
[src]
Sets the STM of this state of identity, which also enables computation of the STM for trajectory optimization
pub fn with_stm(self) -> Self
[src]
Copies the current state but sets the STM to identity
pub fn stm_identity(&mut self)
[src]
Sets the STM of this state of identity
pub fn stm(&self) -> Matrix6<f64>
[src]
Unwraps this STM, or panics if unset.
Trait Implementations
impl Add<&'_ Orbit> for &Orbit
[src]
type Output = Orbit
The resulting type after applying the +
operator.
fn add(self, other: &Orbit) -> Orbit
[src]
Add one state from another. Frame must be manually changed if needed. STM will be copied from &self.
impl Add<Matrix<f64, U6, U1, <DefaultAllocator as Allocator<f64, U6, U1>>::Buffer>> for Orbit
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: VectorN<f64, U6>) -> Self
[src]
Adds the provided state deviation to this orbit
impl Add<Orbit> for Orbit
[src]
type Output = Orbit
The resulting type after applying the +
operator.
fn add(self, other: Orbit) -> Orbit
[src]
Add one state from another. Frame must be manually changed if needed. STM will be copied from &self.
impl Clone for Orbit
[src]
impl Copy for Orbit
[src]
impl Debug for Orbit
[src]
impl Display for Orbit
[src]
impl EstimateFrom<Orbit> for Orbit
[src]
fn extract(from: &Orbit) -> Self
[src]
fn add_dev(to: &Orbit, dev: VectorN<f64, Self::Size>) -> Orbit
[src]
impl EstimateFrom<SpacecraftState> for Orbit
[src]
fn extract(from: &SpacecraftState) -> Self
[src]
fn add_dev(
to: &SpacecraftState,
dev: VectorN<f64, Self::Size>
) -> SpacecraftState
[src]
to: &SpacecraftState,
dev: VectorN<f64, Self::Size>
) -> SpacecraftState
impl EventEvaluator<Orbit> for UmbraEvent
[src]
fn eval(&self, observer: &Orbit) -> f64
[src]
fn epoch_precision(&self) -> Duration
[src]
Stop searching when the time has converged to less than 0.1 seconds
fn value_precision(&self) -> f64
[src]
Finds the darkest part of an eclipse within 2% of penumbra (i.e. 98% in shadow)
fn eval_crossing(&self, prev_state: &S, next_state: &S) -> bool
[src]
impl EventEvaluator<Orbit> for PenumbraEvent
[src]
fn eval(&self, observer: &Orbit) -> f64
[src]
fn epoch_precision(&self) -> Duration
[src]
Stop searching when the time has converged to less than 0.1 seconds
fn value_precision(&self) -> f64
[src]
Finds the slightest penumbra within 2%(i.e. 98% in visibility)
fn eval_crossing(&self, prev_state: &S, next_state: &S) -> bool
[src]
impl EventEvaluator<Orbit> for Event
[src]
fn epoch_precision(&self) -> Duration
[src]
fn value_precision(&self) -> f64
[src]
fn eval(&self, state: &Orbit) -> f64
[src]
fn eval_crossing(&self, prev_state: &S, next_state: &S) -> bool
[src]
impl LowerExp for Orbit
[src]
impl MdHdlr<Orbit> for OrbitStateOutput
[src]
impl MeasurementDevice<Orbit, StdMeasurement> for GroundStation
[src]
fn measure(&self, rx: &Orbit) -> Option<StdMeasurement>
[src]
Perform a measurement from the ground station to the receiver (rx).
impl NavSolution<Orbit> for KfEstimate<Orbit>
[src]
fn orbital_state(&self) -> Orbit
[src]
fn expected_state(&self) -> Orbit
[src]
impl Neg for Orbit
[src]
type Output = Orbit
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
Subtract one state from another. STM will be copied from &self.
impl Neg for &Orbit
[src]
type Output = Orbit
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
Subtract one state from another. STM will be copied form &self.
impl Octal for Orbit
[src]
impl PartialEq<Orbit> for Orbit
[src]
fn eq(&self, other: &Orbit) -> bool
[src]
Two states are equal if their position are equal within one centimeter and their velocities within one centimeter per second.
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Orbit
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
NOTE: This is not part of unit testing because there is no deseralization of Orbit (yet)
impl State for Orbit
[src]
Implementation of Orbit as a State for orbital dynamics with STM
type Size = U6
Size of the state and its STM
type PropVecSize = U42
fn zeros() -> Self
[src]
Returns a state whose position, velocity and frame are zero, and STM is I_{6x6}.
fn as_vector(&self) -> Result<VectorN<f64, U42>, NyxError>
[src]
fn set(
&mut self,
epoch: Epoch,
vector: &VectorN<f64, U42>
) -> Result<(), NyxError>
[src]
&mut self,
epoch: Epoch,
vector: &VectorN<f64, U42>
) -> Result<(), NyxError>
fn stm(&self) -> Result<Matrix6<f64>, NyxError>
[src]
fn add(self, other: VectorN<f64, Self::Size>) -> Self
[src]
fn ctor_from(
self,
delta_t_s: f64,
vector: &VectorN<f64, Self::PropVecSize>
) -> Self where
DefaultAllocator: Allocator<f64, Self::PropVecSize>,
[src]
self,
delta_t_s: f64,
vector: &VectorN<f64, Self::PropVecSize>
) -> Self where
DefaultAllocator: Allocator<f64, Self::PropVecSize>,
impl Sub<&'_ Orbit> for &Orbit
[src]
type Output = Orbit
The resulting type after applying the -
operator.
fn sub(self, other: &Orbit) -> Orbit
[src]
Subtract one state from another. STM will be copied from &self.
impl Sub<Orbit> for Orbit
[src]
type Output = Orbit
The resulting type after applying the -
operator.
fn sub(self, other: Orbit) -> Orbit
[src]
Subtract one state from another. STM will be copied from &self.
impl TimeTagged for Orbit
[src]
Auto Trait Implementations
impl RefUnwindSafe for Orbit
impl Send for Orbit
impl Sync for Orbit
impl Unpin for Orbit
impl UnwindSafe for Orbit
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> ClosedNeg for T where
T: Neg<Output = T>,
T: Neg<Output = T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,