Skip to main content

TrajectorySolver

Struct TrajectorySolver 

Source
pub struct TrajectorySolver { /* private fields */ }

Implementations§

Source§

impl TrajectorySolver

Source

pub fn new( inputs: BallisticInputs, wind: WindConditions, atmosphere: AtmosphericConditions, ) -> Self

Source

pub fn set_max_range(&mut self, range: f64)

Source

pub fn set_time_step(&mut self, step: f64)

Source

pub fn set_wind_segments(&mut self, segments: Vec<WindSegment>)

Supply downrange-segmented wind. Each segment is (speed_kmh, angle_deg, until_distance_m); the wind for a given downrange distance is the first segment whose until_distance_m exceeds it (a step function), and wind is zero beyond the last segment. An empty list clears segmented wind (reverts to the scalar wind). The angle convention matches WindConditions (0 = headwind, 90 = from the right).

Source

pub fn set_atmo_segments(&mut self, segments: Vec<AtmoSegment>)

Supply downrange-segmented atmosphere (MBA-1137). Each segment is (temp_c, pressure_hpa, humidity_percent, until_distance_m), defined at the shooter base altitude; the per-substep drag density recompute selects the active zone by downrange distance (first zone whose until_distance_m exceeds it; the last zone is held beyond the final threshold). The zone’s base conditions are composed with the vertical altitude lapse via get_local_atmosphere, so a steeply-arcing shot still sees the y-lapse on top of the zone base. An empty list clears segmented atmosphere (reverts to the resolved single-station conditions), so a non-segmented solve is numerically identical to pre-feature behavior.

Source

pub fn solve(&self) -> Result<TrajectoryResult, BallisticsError>

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