ACF $AcfVersion:0$
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
imath::CAkimaInterpolator Class Reference

1D interpolation using the Akima method for smooth, natural-looking curves. More...

#include <CAkimaInterpolator.h>

Inheritance diagram for imath::CAkimaInterpolator:
imath::ISampledFunctionInterpolator imath::TIMathFunction< Argument, Result > istd::IPolymorphic

Classes

struct  Node
 

Public Types

typedef QMap< double, NodeNodes
 
- Public Types inherited from imath::TIMathFunction< Argument, Result >
typedef Argument ArgumentType
 
typedef Result ResultType
 

Public Member Functions

 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
 
- Public Member Functions inherited from imath::TIMathFunction< Argument, Result >
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.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Attributes

Nodes m_nodes
 

Detailed Description

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

Usage Examples

// Create interpolator from data arrays
double positions[] = {0.0, 1.0, 2.0, 3.0, 4.0};
double values[] = {0.0, 1.0, 0.5, 2.0, 1.5};
imath::CAkimaInterpolator interpolator(positions, values, 5);
// Interpolate at arbitrary positions
double result;
if (interpolator.GetValueAt(1.5, result)) {
// result contains interpolated value at x=1.5
}
// Or use direct access
double value = interpolator.GetValueAt(2.3);
// Initialize from ISampledFunction
// (if you have function data in that format)
// interpolator.InitFromFunction(sampledFunction);
1D interpolation using the Akima method for smooth, natural-looking curves.

Akima vs Linear Interpolation

Choose Akima interpolation when:

See also
imath::CLinearInterpolator, imath::ISampledFunctionInterpolator

Definition at line 66 of file CAkimaInterpolator.h.

Member Typedef Documentation

◆ Nodes

typedef QMap<double, Node> imath::CAkimaInterpolator::Nodes

Definition at line 75 of file CAkimaInterpolator.h.

Constructor & Destructor Documentation

◆ CAkimaInterpolator() [1/2]

imath::CAkimaInterpolator::CAkimaInterpolator ( )

◆ CAkimaInterpolator() [2/2]

imath::CAkimaInterpolator::CAkimaInterpolator ( double *  positions,
double *  values,
int  nodesCount 
)

Member Function Documentation

◆ GetValueAt() [1/2]

virtual double imath::CAkimaInterpolator::GetValueAt ( const double &  argument) const
overridevirtual

◆ GetValueAt() [2/2]

virtual bool imath::CAkimaInterpolator::GetValueAt ( const double &  argument,
double &  result 
) const
overridevirtual

◆ InitFromFunction()

virtual bool imath::CAkimaInterpolator::InitFromFunction ( const ISampledFunction function)
overridevirtual

Initialize interpolator based on a sample function.

Implements imath::ISampledFunctionInterpolator.

◆ SetNodes()

void imath::CAkimaInterpolator::SetNodes ( double *  positions,
double *  values,
int  nodesCount 
)

Member Data Documentation

◆ m_nodes

Nodes imath::CAkimaInterpolator::m_nodes
protected

Definition at line 90 of file CAkimaInterpolator.h.


The documentation for this class was generated from the following file: