2019-08-23 11:56:54 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Common.h"
|
|
|
|
#include "Point.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
NS_BF_BEGIN;
|
|
|
|
|
|
|
|
class CubicFuncSpline
|
|
|
|
{
|
|
|
|
public:
|
2025-03-28 08:08:33 -04:00
|
|
|
std::vector<PointF> mInputPoints;
|
2019-08-23 11:56:54 -07:00
|
|
|
float* lagpoly;
|
|
|
|
float* intpoly;
|
|
|
|
float* slopes;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Lagrange();
|
|
|
|
void ComputeSplineSlopes();
|
|
|
|
|
|
|
|
public:
|
|
|
|
CubicFuncSpline();
|
|
|
|
~CubicFuncSpline();
|
|
|
|
|
|
|
|
void AddPt(float x, float y);
|
|
|
|
int GetLength();
|
|
|
|
|
|
|
|
void Calculate();
|
|
|
|
float Evaluate(float x);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class CubicUnitFuncSpline
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::vector<float> mInputPoints;
|
|
|
|
float* lagpoly;
|
|
|
|
float* intpoly;
|
|
|
|
float* slopes;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Lagrange();
|
|
|
|
void ComputeSplineSlopes();
|
|
|
|
|
|
|
|
public:
|
|
|
|
CubicUnitFuncSpline();
|
|
|
|
~CubicUnitFuncSpline();
|
|
|
|
|
|
|
|
void AddPt(float y);
|
|
|
|
int GetLength();
|
|
|
|
|
|
|
|
void Calculate();
|
|
|
|
float Evaluate(float x);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_BF_END;
|