pub struct Bc5dTable { /* private fields */ }Expand description
BC5D table with 4D interpolation (drag type is discrete)
Implementations§
Source§impl Bc5dTable
impl Bc5dTable
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, Bc5dError>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, Bc5dError>
Load a BC5D table from a binary file
Sourcepub fn lookup(
&self,
weight_grains: f64,
base_bc: f64,
muzzle_velocity: f64,
current_velocity: f64,
drag_type: &str,
) -> f64
pub fn lookup( &self, weight_grains: f64, base_bc: f64, muzzle_velocity: f64, current_velocity: f64, drag_type: &str, ) -> f64
Look up a BC correction factor with 4D linear interpolation (drag type is discrete, not interpolated)
§Arguments
weight_grains- Bullet weight in grainsbase_bc- Published BC valuemuzzle_velocity- Initial muzzle velocity in fpscurrent_velocity- Current bullet velocity in fpsdrag_type- “G1” or “G7”
§Returns
Correction factor (multiply published BC by this value)
Sourcepub fn get_effective_bc(
&self,
weight_grains: f64,
base_bc: f64,
muzzle_velocity: f64,
current_velocity: f64,
drag_type: &str,
) -> f64
pub fn get_effective_bc( &self, weight_grains: f64, base_bc: f64, muzzle_velocity: f64, current_velocity: f64, drag_type: &str, ) -> f64
Get the effective BC at a given velocity
This multiplies the base BC by the correction factor from the table.
Sourcepub fn api_version(&self) -> &str
pub fn api_version(&self) -> &str
Get API version used to generate the table
Sourcepub fn total_cells(&self) -> usize
pub fn total_cells(&self) -> usize
Get total number of cells in the table
Sourcepub fn dimensions_str(&self) -> String
pub fn dimensions_str(&self) -> String
Get table dimensions as a string
Sourcepub fn weight_range(&self) -> (f32, f32)
pub fn weight_range(&self) -> (f32, f32)
Get weight range
Sourcepub fn velocity_range(&self) -> (f32, f32)
pub fn velocity_range(&self) -> (f32, f32)
Get velocity range
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bc5dTable
impl RefUnwindSafe for Bc5dTable
impl Send for Bc5dTable
impl Sync for Bc5dTable
impl Unpin for Bc5dTable
impl UnwindSafe for Bc5dTable
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<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.