MathPHP\NumericalAnalysis\Interpolation\ClampedCubicSpline::functionToSplinePoints PHP Метод

functionToSplinePoints() защищенный статический Метод

Evaluate our callback function and derivative at n evenly spaced points on the interval between start and end
protected static functionToSplinePoints ( callable $function, callable $derivative, number $start, number $end, number $n ) : array
$function callable f(x) callback function
$derivative callable f'(x) callback function
$start number the start of the interval
$end number the end of the interval
$n number the number of function evaluations
Результат array
    protected static function functionToSplinePoints(callable $function, callable $derivative, $start, $end, $n) : array
    {
        $points = [];
        $h = ($end - $start) / ($n - 1);
        for ($i = 0; $i < $n; $i++) {
            $xᵢ = $start + $i * $h;
            $f⟮xᵢ⟯ = $function($xᵢ);
            $f’⟮xᵢ⟯ = $derivative($xᵢ);
            $points[$i] = [$xᵢ, $f⟮xᵢ⟯, $f’⟮xᵢ⟯];
        }
        return $points;
    }