Struct curve_sampling::Param
source · pub struct Param<F> { /* private fields */ }
Expand description
Options for sampling the image of functions ℝ → ℝ².
See Sampling::param
.
Implementations§
source§impl<F> Param<F>where
F: FnMut(f64) -> [f64; 2],
impl<F> Param<F>where F: FnMut(f64) -> [f64; 2],
sourcepub fn n(self, n: usize) -> Self
pub fn n(self, n: usize) -> Self
Set the maximum number of evaluations of the function
to build the sampling. Panic if n < 2
.
sourcepub fn viewport(self, vp: BoundingBox) -> Self
pub fn viewport(self, vp: BoundingBox) -> Self
Set the zone of interest for the sampling. Segments that end up outside this box will not be refined.
sourcepub fn init<'a, I>(self, ts: I) -> Selfwhere
I: IntoIterator<Item = &'a f64>,
pub fn init<'a, I>(self, ts: I) -> Selfwhere I: IntoIterator<Item = &'a f64>,
Add initial values of t
such that f(t)
(see [Sampling :: param
]) must be included into the sampling in addition to
the n
evaluations. Only the values between a
and
b
are taken into account (other values are ignored).
sourcepub fn init_pt<'a, I>(self, pts: I) -> Selfwhere
I: IntoIterator<Item = &'a (f64, [f64; 2])>,
pub fn init_pt<'a, I>(self, pts: I) -> Selfwhere I: IntoIterator<Item = &'a (f64, [f64; 2])>,
Add initial points (t, f(t))
to include into the
sampling in addition to the n
evaluations. This
allows you to use previous evaluations of f
. Only
the couples with first coordinate t
between a
and
b
(see [Sampling :: param
]) are considered (other values are ignored).