public static function grid(float $min, float $max, int $n = 10) : array
    {
        if ($min > $max) {
            throw new InvalidArgumentException('Max cannot be less'
                . ' then min.');
        }

        if ($n < 2) {
            throw new InvalidArgumentException('Cannot generate less'
                . ' than 2 parameters.');
        }

        $interval = ($max - $min) / ($n - 1);

        return range($min, $max, $interval);
    }
public static function grid(float $min, float $max, int $n = 10) : array
    {
        if ($min > $max) {
            throw new InvalidArgumentException('Max cannot be less'
                . ' then min.');
        }

        if ($n < 2) {
            throw new InvalidArgumentException('Cannot generate less'
                . ' than 2 parameters.');
        }

        $interval = ($max - $min) / ($n - 1);

        return range($min, $max, $interval);
    }
public static function grid ( float $ min , float $ max , int $ n = 10 ) : array { if ( $ min > $ max ) { throw new InvalidArgumentException ( 'Max cannot be less' . ' then min.' ) ; } if ( $ n < 2 ) { throw new InvalidArgumentException ( 'Cannot generate less' . ' than 2 parameters.' ) ; } $ interval = ( $ max - $ min ) / ( $ n - 1 ) ; return range ( $ min , $ max , $ interval ) ; }
Generate a grid of evenly distributed parameters.

@param float $min
@param float $max
@param int $n
@throws \InvalidArgumentException
@return float[]
Generate a grid of evenly distributed parameters .