MathPHP\NumericalAnalysis\Interpolation\Interpolation::functionToPoints PHP Метод

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

Evaluate our callback function at n evenly spaced points on the interval between start and end
protected static functionToPoints ( callable $function, number $start, number $end, number $n ) : array
$function 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 functionToPoints(callable $function, $start, $end, $n) : array
    {
        $points = [];
        $h = ($end - $start) / ($n - 1);
        for ($i = 0; $i < $n; $i++) {
            $xᵢ = $start + $i * $h;
            $f⟮xᵢ⟯ = $function($xᵢ);
            $points[$i] = [$xᵢ, $f⟮xᵢ⟯];
        }
        return $points;
    }