Я пытаюсь использовать библиотеку Eigen для создания сплайнов. Однако, как только я создаю сплайн, я не знаю, как получить значение, которое будет в данной точке x.
См. пример ниже с пояснениями моих намерений:
#include <Eigen/Core>
#include <unsupported/Eigen/Splines>
int main(int argc, char const* argv[])
{
// points at (0,0) (15,12) and (30,17)
Eigen::MatrixXd points(2, 3);
points << 0, 15, 30,
0, 12, 17;
typedef Eigen::Spline<double, 2> spline2d;
spline2d s = Eigen::SplineFitting<spline2d>::Interpolate(points, 2);
// I now have a spline called s.
// I want to do something like:
double x = 12.34;
double new_y = s(x)[1]; // However this s() function uses a chord value. What is a chord value?
// Is there a:
double new_y2 = s.eval(x)
}