pub struct KeplerConfig {
pub central_mass: f64,
pub orbiter_mass: f64,
pub semi_major_axis: f64,
pub eccentricity: f64,
pub initial_anomaly: f64,
}Expand description
Kepler two-body configuration.
Fields§
§central_mass: f64Central body mass (kg).
orbiter_mass: f64Orbiting body mass (kg).
semi_major_axis: f64Semi-major axis (m).
eccentricity: f64Eccentricity (0-1 for ellipses).
initial_anomaly: f64Initial true anomaly (radians).
Implementations§
Source§impl KeplerConfig
impl KeplerConfig
Sourcepub fn circular(central_mass: f64, orbiter_mass: f64, radius: f64) -> Self
pub fn circular(central_mass: f64, orbiter_mass: f64, radius: f64) -> Self
Create circular orbit.
Sourcepub fn circular_velocity(&self) -> f64
pub fn circular_velocity(&self) -> f64
Calculate circular orbital velocity at semi-major axis.
Sourcepub fn build(&self, softening: f64) -> NBodyState
pub fn build(&self, softening: f64) -> NBodyState
Build N-body state from this configuration.
Trait Implementations§
Source§impl Clone for KeplerConfig
impl Clone for KeplerConfig
Source§fn clone(&self) -> KeplerConfig
fn clone(&self) -> KeplerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeplerConfig
impl Debug for KeplerConfig
Source§impl Default for KeplerConfig
impl Default for KeplerConfig
Source§impl<'de> Deserialize<'de> for KeplerConfig
impl<'de> Deserialize<'de> for KeplerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KeplerConfig
impl RefUnwindSafe for KeplerConfig
impl Send for KeplerConfig
impl Sync for KeplerConfig
impl Unpin for KeplerConfig
impl UnsafeUnpin for KeplerConfig
impl UnwindSafe for KeplerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more