Struct nyx_space::Orbit[][src]

pub struct Orbit {
    pub x: f64,
    pub y: f64,
    pub z: f64,
    pub vx: f64,
    pub vy: f64,
    pub vz: f64,
    pub dt: Epoch,
    pub frame: Frame,
    pub stm: Option<Matrix6<f64>>,
    pub stm_kind: StmKind,
}
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: 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

stm: Option<Matrix6<f64>>

Optionally stores an STM

stm_kind: StmKind

Implementations

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

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

Creates a new Orbit and initializes its STM.

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

Units: km, km, km

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.

Returns the magnitude of the radius vector in km

Returns the magnitude of the velocity vector in km/s

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

Returns the velocity vector of this Orbit in [km/s, km/s, km/s]

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.

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

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

Returns the unit vector in the direction of the state radius

Returns the unit vector in the direction of the state velocity

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.

Creates a new Orbit from the provided semi-major axis altitude in kilometers

Creates a new Orbit from the provided radii of apoapsis and periapsis, in kilometers

Creates a new Orbit from the provided altitudes of apoapsis and periapsis, in kilometers

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.

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.

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

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

Note that the time is not returned in the vector.

Returns the orbital momentum vector

Returns the orbital momentum value on the X axis

Returns the orbital momentum value on the Y axis

Returns the orbital momentum value on the Z axis

Returns the norm of the orbital momentum

Returns the specific mechanical energy

Returns the semi-major axis in km

Mutates this orbit to change the SMA

Returns a copy of the state with a new SMA

Returns a copy of the state with a provided SMA added to the current one

Returns the period in seconds

Returns the eccentricity vector (no unit)

Returns the eccentricity (no unit)

Mutates this orbit to change the ECC

Returns a copy of the state with a new ECC

Returns a copy of the state with a provided ECC added to the current one

Returns the inclination in degrees

Mutates this orbit to change the INC

Returns a copy of the state with a new INC

Returns a copy of the state with a provided INC added to the current one

Returns the argument of periapsis in degrees

Mutates this orbit to change the AOP

Returns a copy of the state with a new AOP

Returns a copy of the state with a provided AOP added to the current one

Returns the right ascension of ther ascending node in degrees

Mutates this orbit to change the RAAN

Returns a copy of the state with a new RAAN

Returns a copy of the state with a provided RAAN added to the current one

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

Mutates this orbit to change the TA

Returns a copy of the state with a new TA

Returns a copy of the state with a provided TA added to the current one

Returns a copy of this state with the provided apoasis and periapse

Returns a copy of this state with the provided apoasis and periapse added to the current values

Returns the true longitude in degrees

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.

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

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

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

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

Returns the eccentric anomaly in degrees

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

Returns the flight path angle in degrees

Returns the mean anomaly in degrees

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

Returns the semi parameter (or semilatus rectum)

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).

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

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

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

Returns the geodetic height in km.

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

Returns the right ascension of this orbit in degrees

Returns the declination of this orbit in degrees

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

Returns the velocity declination of this orbit in degrees

Returns the $C_3$ of this orbit

Returns the radius of periapse in kilometers for the provided turn angle of this hyperbolic orbit.

Returns the turn angle in degrees for the provided radius of periapse passage of this hyperbolic orbit

Returns the hyperbolic anomaly in degrees between 0 and 360.0

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

Apply the provided delta-v (in km/s)

Copies this orbit after applying the provided delta-v (in km/s)

Rotate this state provided a direct cosine matrix of position and velocity

Rotate this state provided a direct cosine matrix of position and velocity

Rotate the position and the velocity of this state provided a direct cosine matrix of position and velocity WARNING: You only want to use this if you’ll only be using the position components of the rotated state. This does not account for the transport theorem and therefore is physically WRONG.

Rotate the position of this state provided a direct cosine matrix of position and velocity WARNING: You only want to use this if you’ll only be using the position components of the rotated state. This does not account for the transport theorem and therefore is physically WRONG.

Sets the STM of this state of identity, which also enables computation of the STM for spacecraft navigation

Sets the STM of this state of identity, which also enables computation of the STM for trajectory optimization

Disable the STM of this state

Copies the current state but sets the STM to identity

Copies the current state but disables the STM

Sets the STM of this state of identity

Unwraps this STM, or panics if unset.

Returns the root sum square error between this state and the other, in kilometers for the position and kilometers per second in velocity

Trait Implementations

Add one state from another. Frame must be manually changed if needed. STM will be copied from &self.

The resulting type after applying the + operator.

Adds the provided state deviation to this orbit

The resulting type after applying the + operator.

Add one state from another. Frame must be manually changed if needed. STM will be copied from &self.

The resulting type after applying the + operator.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Stop searching when the time has converged to less than 0.1 seconds

Finds the darkest part of an eclipse within 2% of penumbra (i.e. 98% in shadow)

Stop searching when the time has converged to less than 0.1 seconds

Finds the slightest penumbra within 2%(i.e. 98% in visibility)

Initialize a new OrbitDual from an orbit, no other initializers

Formats the value using the given formatter.

Perform a measurement from the ground station to the receiver (rx).

Returns the nominal state as computed by the dynamics

Subtract one state from another. STM will be copied from &self.

The resulting type after applying the - operator.

Subtract one state from another. STM will be copied form &self.

The resulting type after applying the - operator.

Formats the value using the given formatter.

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

This method tests for !=.

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

Implementation of Orbit as a State for orbital dynamics with STM

Returns a state whose position, velocity and frame are zero, and STM is I_{6x6}.

Size of the state and its STM

Return this state as a vector for the propagation/estimation

Set this state

Return this state as a vector for the propagation/estimation

Reconstruct a new State from the provided delta time in seconds compared to the current state and with the provided vector. Read more

Subtract one state from another. STM will be copied from &self.

The resulting type after applying the - operator.

Subtract one state from another. STM will be copied from &self.

The resulting type after applying the - operator.

Retrieve the Epoch

Set the Epoch

Shift this epoch by a duration (can be negative)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

Should always be Self

Performance hack: Clone doesn’t get inlined for Copy types in debug mode, so make it inline anyway.

Tests if Self the same as the type T Read more

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

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

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

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.