Skip to main content

Interpolator

Trait Interpolator 

Source
pub trait Interpolator {
    // Required method
    fn interpolate(&self, x: f64) -> f64;

    // Provided method
    fn sample(&self, start: f64, end: f64, num_points: usize) -> Vec<Point2D> { ... }
}
Expand description

Interpolation trait for different curve types.

Required Methods§

Source

fn interpolate(&self, x: f64) -> f64

Interpolate y value at given x.

Provided Methods§

Source

fn sample(&self, start: f64, end: f64, num_points: usize) -> Vec<Point2D>

Generate points along the curve.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§