46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
/**********************************************************************
|
|
* Author: tstern
|
|
*
|
|
Copyright (C) 2018 MisfitTech, All rights reserved.
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
Written by Trampas Stern for MisfitTech.
|
|
|
|
Misfit Tech invests time and resources providing this open source code,
|
|
please support MisfitTech and open-source hardware by purchasing
|
|
products from MisfitTech, www.misifittech.net!
|
|
*********************************************************************/
|
|
|
|
#include "utils.h"
|
|
#include "syslog.h"
|
|
|
|
double CubicInterpolate(
|
|
double y0,double y1,
|
|
double y2,double y3,
|
|
double mu)
|
|
{
|
|
double a0,a1,a2,a3,mu2;
|
|
|
|
mu2 = mu*mu;
|
|
a0 = y3 - y2 - y0 + y1;
|
|
a1 = y0 - y1 - a0;
|
|
a2 = y2 - y0;
|
|
a3 = y1;
|
|
|
|
return(a0*mu*mu2+a1*mu2+a2*mu+a3);
|
|
}
|
|
|
|
|
|
|