Enum maelstrom_plot::PlotPoints
source · pub enum PlotPoints {
Owned(Vec<PlotPoint>),
Generator(ExplicitGenerator),
}
Expand description
Represents many PlotPoint
s.
These can be an owned Vec
or generated with a function.
Variants§
Implementations§
source§impl PlotPoints
impl PlotPoints
pub fn new(points: Vec<[f64; 2]>) -> Self
pub fn points(&self) -> &[PlotPoint]
sourcepub fn from_explicit_callback(
function: impl Fn(f64) -> f64 + 'static,
x_range: impl RangeBounds<f64>,
points: usize
) -> Self
pub fn from_explicit_callback( function: impl Fn(f64) -> f64 + 'static, x_range: impl RangeBounds<f64>, points: usize ) -> Self
Draw a line based on a function y=f(x)
, a range (which can be infinite) for x and the number of points.
sourcepub fn from_parametric_callback(
function: impl Fn(f64) -> (f64, f64),
t_range: impl RangeBounds<f64>,
points: usize
) -> Self
pub fn from_parametric_callback( function: impl Fn(f64) -> (f64, f64), t_range: impl RangeBounds<f64>, points: usize ) -> Self
Draw a line based on a function (x,y)=f(t)
, a range for t and the number of points.
The range may be specified as start..end or as start..=end.
sourcepub fn from_ys_f32(ys: &[f32]) -> Self
pub fn from_ys_f32(ys: &[f32]) -> Self
From a series of y-values. The x-values will be the indices of these values
sourcepub fn from_ys_f64(ys: &[f64]) -> Self
pub fn from_ys_f64(ys: &[f64]) -> Self
From a series of y-values. The x-values will be the indices of these values
Trait Implementations§
source§impl Default for PlotPoints
impl Default for PlotPoints
source§impl FromIterator<[f64; 2]> for PlotPoints
impl FromIterator<[f64; 2]> for PlotPoints
Auto Trait Implementations§
impl !RefUnwindSafe for PlotPoints
impl !Send for PlotPoints
impl !Sync for PlotPoints
impl Unpin for PlotPoints
impl !UnwindSafe for PlotPoints
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