pub struct ProfileField { /* private fields */ }Expand description
Piecewise-linear vertical profile: speed interpolates linearly in altitude, direction along the shortest circular arc; nearest level holds outside the range.
The field reads only the height (position_m.y), on the same datum as the levels’
altitude_m. A query exactly at a level gives that level’s own vector, and exactly opposite
neighbouring directions turn clockwise (increasing FROM angle). Vertical wind is zero.
Implementations§
Source§impl ProfileField
impl ProfileField
Sourcepub fn new(levels: Vec<ProfileLevel>) -> Result<ProfileField, WindFieldError>
pub fn new(levels: Vec<ProfileLevel>) -> Result<ProfileField, WindFieldError>
Build a profile from levels in any order.
Every value must be finite and every speed >= 0; these checks run before sorting, so a
WindFieldError::InvalidLevel index refers to the caller’s own ordering. After
sorting, two levels at the same altitude are rejected with
WindFieldError::DuplicateAltitude.
Sourcepub fn levels(&self) -> &[ProfileLevel]
pub fn levels(&self) -> &[ProfileLevel]
The levels, sorted by ascending altitude.
Sourcepub fn wind_at(
&self,
altitude_m: f64,
) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
pub fn wind_at( &self, altitude_m: f64, ) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
Wind (m/s) at an altitude. A NaN altitude gives zero wind, as
WindSock::vector_for_range_stateless does for a NaN range.
Trait Implementations§
Source§impl Clone for ProfileField
impl Clone for ProfileField
Source§fn clone(&self) -> ProfileField
fn clone(&self) -> ProfileField
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProfileField
impl Debug for ProfileField
Source§impl PartialEq for ProfileField
impl PartialEq for ProfileField
impl StructuralPartialEq for ProfileField
Auto Trait Implementations§
impl Freeze for ProfileField
impl RefUnwindSafe for ProfileField
impl Send for ProfileField
impl Sync for ProfileField
impl Unpin for ProfileField
impl UnsafeUnpin for ProfileField
impl UnwindSafe for ProfileField
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.