pub struct LinearSpline<P: VectorSpace> {
pub points: Vec<P>,
}Expand description
A spline interpolated linearly between the nearest 2 points.
§Interpolation
The curve passes through every control point.
§Tangency
The curve is not generally differentiable at control points.
§Continuity
The curve is C0 continuous, meaning it has no holes or jumps.
§Parametrization
Each curve segment connects two adjacent control points in sequence. When a cyclic curve is
formed with to_curve_cyclic, the final segment connects the last control point with the first.
Fields§
§points: Vec<P>The control points of the linear spline.
Implementations§
Source§impl<P: VectorSpace> LinearSpline<P>
impl<P: VectorSpace> LinearSpline<P>
Sourcepub fn new(points: impl IntoIterator<Item = P>) -> Self
pub fn new(points: impl IntoIterator<Item = P>) -> Self
Create a new linear spline from a list of points to be interpolated.
Trait Implementations§
Source§impl<P: Clone + VectorSpace> Clone for LinearSpline<P>
impl<P: Clone + VectorSpace> Clone for LinearSpline<P>
Source§fn clone(&self) -> LinearSpline<P>
fn clone(&self) -> LinearSpline<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: VectorSpace> CubicGenerator<P> for LinearSpline<P>
Available on crate feature alloc only.
impl<P: VectorSpace> CubicGenerator<P> for LinearSpline<P>
Available on crate feature
alloc only.Source§type Error = InsufficientDataError
type Error = InsufficientDataError
An error type indicating why construction might fail.
Source§fn to_curve(&self) -> Result<CubicCurve<P>, Self::Error>
fn to_curve(&self) -> Result<CubicCurve<P>, Self::Error>
Build a
CubicCurve by computing the interpolation coefficients for each curve segment.Source§impl<P: VectorSpace> CyclicCubicGenerator<P> for LinearSpline<P>
Available on crate feature alloc only.
impl<P: VectorSpace> CyclicCubicGenerator<P> for LinearSpline<P>
Available on crate feature
alloc only.Source§type Error = InsufficientDataError
type Error = InsufficientDataError
An error type indicating why construction might fail.
Source§fn to_curve_cyclic(&self) -> Result<CubicCurve<P>, Self::Error>
fn to_curve_cyclic(&self) -> Result<CubicCurve<P>, Self::Error>
Build a cyclic
CubicCurve by computing the interpolation coefficients for each curve segment,
treating the control data as cyclic so that the result is a closed curve.Auto Trait Implementations§
impl<P> Freeze for LinearSpline<P>
impl<P> RefUnwindSafe for LinearSpline<P>where
P: RefUnwindSafe,
impl<P> Send for LinearSpline<P>where
P: Send,
impl<P> Sync for LinearSpline<P>where
P: Sync,
impl<P> Unpin for LinearSpline<P>where
P: Unpin,
impl<P> UnsafeUnpin for LinearSpline<P>
impl<P> UnwindSafe for LinearSpline<P>where
P: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of
self.