Are there alternative libraries in PHP that can handle pathwalking for determining if a coordinate is above or below a line?

When determining if a coordinate is above or below a line, you can use the mathematical equation of the line to calculate the expected y-coordinate for a given x-coordinate. If the actual y-coordinate is above the expected y-coordinate, the point is considered above the line, and vice versa.

function isAboveLine($x, $y, $m, $b) {
    $expectedY = $m * $x + $b;
    
    if ($y > $expectedY) {
        return true; // Coordinate is above the line
    } else {
        return false; // Coordinate is below the line
    }
}

// Example usage
$x = 3;
$y = 5;
$m = 2;
$b = 1;

if (isAboveLine($x, $y, $m, $b)) {
    echo "Coordinate is above the line";
} else {
    echo "Coordinate is below the line";
}