Report a bug
If you spot a problem with this page, click here to create a Github issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.interpolate.utility

struct ParabolaKernel(T);

ParabolaKernel!(Unqual!(typeof(X.init - Y.init))) parabolaKernel(X, Y)(in X x0, in X x1, in X x2, in Y y0, in Y y1, in Y y2);
ParabolaKernel structure.
Examples:
import std.math: approxEqual;

alias f = (double x) => 3 * (x ^^ 2) + 7 * x + 5;
auto p = parabolaKernel(4, 9, 20, f(4), f(9), f(20));

assert(p.a.approxEqual(3));
assert(p.b.approxEqual(7));
assert(p.c.approxEqual(5));
assert(p(10).approxEqual(f(10)));
T a;
T b;
T c;
this(T)(T x0, T x1, T x2, T y0, T y1, T y2);
Builds parabola given three points
const auto opCall(uint derivative = 0)(T x)
if (derivative <= 2);
alias withDerivative = opCall!1;
alias withTwoDerivatives = opCall!2;