|
| | CAkimaInterpolator () |
| |
| | CAkimaInterpolator (double *positions, double *values, int nodesCount) |
| |
| void | SetNodes (double *positions, double *values, int nodesCount) |
| |
| virtual bool | InitFromFunction (const ISampledFunction &function) override |
| | Initialize interpolator based on a sample function.
|
| |
| virtual bool | GetValueAt (const double &argument, double &result) const override |
| |
| virtual double | GetValueAt (const double &argument) const override |
| |
| virtual bool | GetValueAt (const Argument &argument, Result &result) const =0 |
| | Get function value for specified argument value.
|
| |
| virtual Result | GetValueAt (const Argument &argument) const =0 |
| | Get function value for specified argument value.
|
| |
| virtual | ~IPolymorphic () |
| |
1D interpolation using the Akima method for smooth, natural-looking curves.
Purpose
CAkimaInterpolator provides smooth interpolation through a set of data points using the Akima spline method. This method produces curves that are less prone to oscillation than cubic splines, making it particularly suitable for visualizing scientific data or creating smooth transitions in animations and simulations.
Characteristics
- Smoothness: C1 continuous (continuous first derivative)
- Locality: Changes to one data point only affect nearby segments
- No overshooting: Less prone to oscillation compared to cubic splines
- Natural appearance: Produces visually pleasing curves for most datasets
Usage Examples
double positions[] = {0.0, 1.0, 2.0, 3.0, 4.0};
double values[] = {0.0, 1.0, 0.5, 2.0, 1.5};
double result;
if (interpolator.GetValueAt(1.5, result)) {
}
double value = interpolator.GetValueAt(2.3);
1D interpolation using the Akima method for smooth, natural-looking curves.
Akima vs Linear Interpolation
- Akima: Smooth curves, C1 continuous, better for visualization
- Linear: Piecewise linear, simpler, better for data with sharp transitions
Choose Akima interpolation when:
- You need smooth, natural-looking curves
- Data represents continuous physical phenomena
- Visual quality is important
- Data points are reasonably spaced
- See also
- imath::CLinearInterpolator, imath::ISampledFunctionInterpolator
Definition at line 66 of file CAkimaInterpolator.h.