#[repr(u8)]pub enum InterpolationType {
Linear = 0,
Cubic = 1,
Spline = 2,
Bilinear = 3,
}Expand description
Represents the different types of interpolation methods supported in the library.
This enum defines the available interpolation techniques that can be used in various mathematical modeling, data analysis, and visualization scenarios. Each interpolation method has unique characteristics making it suitable for different applications.
§Variants
-
Linear:
Performs linear interpolation. This method calculates interpolated values by connecting two adjacent points on a line and using the slope between them to determine new values. -
Cubic:
Utilizes cubic interpolation, which involves fitting a cubic polynomial between data points to provide a smoother curve. This is commonly used for precise curve fitting and smoothing applications. -
Spline:
Implements spline interpolation, typically involving piecewise polynomials (e.g., cubic splines) that ensure smooth transitions between data points while maintaining continuity of derivatives at the joins. Spline methods are widely used in mathematical modeling and graphical applications. -
Bilinear:
A two-dimensional extension of linear interpolation. Commonly used in grid-based data interpolation, bilinear interpolation calculates the value at a point within a cell of a 2D grid based on the values at the vertices of the cell.
§Usage
This enumeration is typically used as part of a larger interpolation framework,
providing a way to select the desired interpolation method. Each variant corresponds
to a specific interpolation strategy, and implementations for these can be found in
their respective modules (e.g., linear, cubic, spline, bilinear).
§Integration
The InterpolationType enum is re-exported in the library’s root module to make it
easily accessible as part of the public API. It works in conjunction with traits such as
Interpolate, allowing users to dynamically specify the desired interpolation type
when performing operations.
§Example Use Case
While the InterpolationType enum itself does not contain any methods or logic,
it serves as a configuration point for choosing the interpolation method to be used
in a context where multiple types of interpolation are supported.
§See Also
crate::geometrics::LinearInterpolation: Implements linear interpolation.crate::geometrics::CubicInterpolation: Implements cubic interpolation.crate::geometrics::SplineInterpolation: Implements spline interpolation.crate::geometrics::BiLinearInterpolation: Implements bilinear interpolation.
This enum is part of a modular design, with each interpolation type defined in its own module for clarity and separation of concerns.
Variants§
Linear = 0
Linear interpolation that calculates values by drawing straight lines between data points. Efficient but may lack smoothness for certain applications.
Cubic = 1
Cubic interpolation that uses third-degree polynomials to create smoother curves between data points, providing better continuity than linear interpolation.
Spline = 2
Spline interpolation that ensures smooth curves with continuous first and second derivatives at the connection points between interpolation segments.
Bilinear = 3
Bilinear interpolation for two-dimensional data, performing linear interpolation first in one direction and then in the other, used commonly in image processing and spatial data analysis.
Trait Implementations§
Source§impl Clone for InterpolationType
impl Clone for InterpolationType
impl Copy for InterpolationType
Source§impl Debug for InterpolationType
impl Debug for InterpolationType
impl Eq for InterpolationType
Source§impl Hash for InterpolationType
impl Hash for InterpolationType
Source§impl Ord for InterpolationType
impl Ord for InterpolationType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for InterpolationType
impl PartialEq for InterpolationType
Source§impl PartialOrd for InterpolationType
impl PartialOrd for InterpolationType
impl StructuralPartialEq for InterpolationType
Auto Trait Implementations§
impl Freeze for InterpolationType
impl RefUnwindSafe for InterpolationType
impl Send for InterpolationType
impl Sync for InterpolationType
impl Unpin for InterpolationType
impl UnsafeUnpin for InterpolationType
impl UnwindSafe for InterpolationType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.