[−][src]Struct cubic_spline::Spline
Interpolation methods for computation of cubic spline points within the range of a discrete set of known points. Collection for calculate spline points
Methods
impl Spline
[src]
pub fn from_flatten_points(points: &[f64], opts: &SplineOpts) -> Vec<f64>
[src]
Calculates flat vector of points from known points
Points is vec of [x, y, x, y, ...]
Example
use cubic_spline::{Spline, SplineOpts}; let opts: SplineOpts = Default::default(); let points = vec![10.0, 200.0, 256.0, 390.0, 512.0, 10.0, 778.0, 200.0]; let spline_points = Spline::from_flatten_points(&points, &opts); assert_eq!(spline_points.len(), 102);
pub fn from_tuples(points: &[(f64, f64)], opts: &SplineOpts) -> Vec<(f64, f64)>
[src]
Calculates vector of point tuples from known points
Points is vec of [(x, y), (x, y), ...]
Example
use cubic_spline::{Spline, SplineOpts}; let opts: SplineOpts = Default::default(); let points = vec![(10.0, 200.0), (256.0, 390.0), (512.0, 10.0), (778.0, 200.0)]; let spline_points = Spline::from_tuples(&points, &opts); let (last_x, last_y) = spline_points.last().unwrap(); assert_eq!(*last_y, 200.0_f64);
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,