pub struct DragTable {
pub mach_values: Vec<f64>,
pub cd_values: Vec<f64>,
}Expand description
Drag table data structure
Fields§
§mach_values: Vec<f64>§cd_values: Vec<f64>Implementations§
Source§impl DragTable
impl DragTable
Sourcepub fn new(mach_values: Vec<f64>, cd_values: Vec<f64>) -> Self
pub fn new(mach_values: Vec<f64>, cd_values: Vec<f64>) -> Self
Create a new drag table from mach and cd arrays
Sourcepub fn interpolate(&self, mach: f64) -> f64
pub fn interpolate(&self, mach: f64) -> f64
Interpolate drag coefficient for given Mach number using cubic spline-like interpolation
Sourcepub fn linear_interpolate(&self, mach: f64, idx: usize) -> f64
pub fn linear_interpolate(&self, mach: f64, idx: usize) -> f64
Linear interpolation between two points
Sourcepub fn cubic_interpolate(&self, mach: f64, idx: usize) -> f64
pub fn cubic_interpolate(&self, mach: f64, idx: usize) -> f64
Cubic interpolation using 4 points (similar to cubic spline)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DragTable
impl RefUnwindSafe for DragTable
impl Send for DragTable
impl Sync for DragTable
impl Unpin for DragTable
impl UnwindSafe for DragTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.