This lib is considered to be used as a sensor's calibration program. Calibration with Spline Interpolation might be useful in the case that you want some model expressing relationship such like between a value of physical quantity and your sensor's voltage, but you cannot estimate a model such as liner, square, cubic polynomial, or sine curve. This makes (Parametric) Cubic Spline Polynomial Model (Coefficients of the polynomial) from some sample plots(e.g. sets of (value, voltage)). The inverse function (x,y)->(y,x) has been implemented so as to get analog data (not stepping or leveled data).

Fork of TRP105F_Spline by Akifumi Takahashi

Revision:
11:a279e31d8499
Parent:
10:607a68db6303
Child:
12:b3e07a2220bc
--- a/CubicSpline.cpp	Sun May 29 09:23:24 2016 +0000
+++ b/CubicSpline.cpp	Sun May 29 09:31:44 2016 +0000
@@ -376,8 +376,10 @@
     if(D <= 0) {
         u = std::complex<double>(-q, sqrt(-D));
         v = std::complex<double>(-q,-sqrt(-D));
-        u = pow(u, 1/3);
-        v = pow(v, 1/3);
+        //u = pow(u, 1/3);
+        //v = pow(v, 1/3);
+        u = std::exp(std::log(u)/3);
+        v = std::exp(std::log(u)/3);
     }
     //One real root and two complex root
     else {