Class CubicHermite
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.univariate.CubicHermite
-
- All Implemented Interfaces:
CurveFitting
,Interpolation
public class CubicHermite extends Object implements Interpolation
Cubic Hermite spline interpolation is a piecewise spline interpolation, in which each polynomial is in Hermite form which consists of two control points and two control tangents. UnlikeCubicSpline
interpolation, where the interpolated splines depend on each point, this method performs piecewise interpolation. The method for computing the control tangents is non-unique and various approaches exist.- See Also:
- Wikipedia: Cubic Hermite spline
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CubicHermite.Tangent
The method for computing the control tangent at a given index.static class
CubicHermite.Tangents
-
Constructor Summary
Constructors Constructor Description CubicHermite()
Construct an instance withCubicHermite.Tangents.CATMULL_ROM
as the method for computing tangents.CubicHermite(CubicHermite.Tangent tangent)
Construct an instance with the given method to compute tangents.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnivariateRealFunction
fit(OrderedPairs op)
Fit a real valued function from a discrete set of data points.
-
-
-
Constructor Detail
-
CubicHermite
public CubicHermite()
Construct an instance withCubicHermite.Tangents.CATMULL_ROM
as the method for computing tangents.
-
CubicHermite
public CubicHermite(CubicHermite.Tangent tangent)
Construct an instance with the given method to compute tangents.- Parameters:
tangent
- computes the control tangents used for the interpolation
-
-
Method Detail
-
fit
public UnivariateRealFunction fit(OrderedPairs op)
Description copied from interface:Interpolation
Fit a real valued function from a discrete set of data points. The interpolated function must pass through all the given points.- Specified by:
fit
in interfaceCurveFitting
- Specified by:
fit
in interfaceInterpolation
- Parameters:
op
-- Returns:
- the interpolated function
-
-