Trait ParametricFunction2D

Source
pub trait ParametricFunction2D {
    // Required method
    fn evaluate(&self, t: T) -> Point;

    // Provided methods
    fn linspace(&self, n: usize) -> Vec<Point>  { ... }
    fn start(&self) -> Point { ... }
    fn end(&self) -> Point { ... }
    fn random_point(&self) -> Point { ... }
    fn random_points(&self, n: usize) -> Vec<Point>  { ... }
}
Expand description

2D parametric function trait

Required Methods§

Source

fn evaluate(&self, t: T) -> Point

returns the value of the parametric function at the point t

Provided Methods§

Source

fn linspace(&self, n: usize) -> Vec<Point>

returns n equally spaced points along the entire parametric function from T::start to T::end

Source

fn start(&self) -> Point

returns start, or “first”, point on the parametric function

Source

fn end(&self) -> Point

returns end, or“last“, point on the parametric function

Source

fn random_point(&self) -> Point

return a random point on the parametric function

Source

fn random_points(&self, n: usize) -> Vec<Point>

return n random points on the parametric function

Implementations on Foreign Types§

Source§

impl<F, G> ParametricFunction2D for (F, G)

Source§

fn evaluate(&self, t: T) -> Point

Implementors§