1+ /*! @page qinterp1_desc 1D Interpolation class
2+ * The \ref qInterp1 class provides a simple, consistent interface for a set of
3+ * one-dimensional interpolators. The class recieves X-Values and Y-Values and
4+ * the size of this arrays to setup the instance. The user can later pass the
5+ * X point to interpolate, and the interpolator instance return the estimated Y
6+ * at the point X using the specified method.
7+ *
8+ * The current supported methods are:
9+ * - QINTERP1_NEXT : Return the next neighbor.
10+ * - QINTERP1_PREVIOUS : Return the previous neighbor.
11+ * - QINTERP1_NEAREST : Return the nearest neighbor.
12+ * - QINTERP1_LINEAR : Linear interpolation from nearest neighbors.
13+ * - QINTERP1_SINE : Sine interpolation.
14+ * - QINTERP1_CUBIC : Cubic interpolation.
15+ * - QINTERP1_HERMITE : Piecewise cubic Hermite interpolation.
16+ * - QINTERP1_SPLINE : Catmull spline interpolation.
17+ * - QINTERP1_CONSTRAINED_SPLINE : A special kind of spline that doesn't overshoot.
18+ *
19+ * If value is beyond the endpoints, extrapolation is performed using the current
20+ * method.
21+ *
22+ * @section qinterp1_ex1 Example : Code snippet that demonstrates the spline interpolation .
23+ *
24+ * @code{.c}
25+ * float xdat[] = { 1.0f, 6.0f, 11.0f, 16.0f, 21.0f, 26.0f, 31.0f, 36.0f };
26+ * float ydat[] = { 59.6870f, 44.5622f, -0.8642f , 0.8725f, -2.3016f, -50.3095f, -54.5966f, 37.9036f };
27+ * qInterp1_t interpolator( xdat, ydat );
28+ * qInterp1_Setup( &interpolator, xdat, ydat, sizeof(xdat)/sizeof(xdat[0]) );
29+ * qInterp1_SetMethod( &interpolator, QINTERP1_SPLINE );
30+ * float ye = qInterp1_Get( &interpolator, 18.5f ); //interpolated value at 18.5
31+ * @endcode
32+ *
33+ */
0 commit comments