src/Maths/Geometry/Line.php
public function getSlope()
    {
        if ($this->isVertical()) {
            return Maths::INFINITY;
        } else {
            $r = ($this->getPointB()->getAbscissa() - $this->getPointA()->getAbscissa());
            return (
                ($this->getPointB()->getOrdinate() - $this->getPointA()->getOrdinate())
                /
                ($r!=0 ? $r : 1)
            );
        }
    }
public function getSlope()
    {
        if ($this->isVertical()) {
            return Maths::INFINITY;
        } else {
            $r = ($this->getPointB()->getAbscissa() - $this->getPointA()->getAbscissa());
            return (
                ($this->getPointB()->getOrdinate() - $this->getPointA()->getOrdinate())
                /
                ($r!=0 ? $r : 1)
            );
        }
    }
Get the slope of the line: m = (By - Ay) / (Bx - Ax)

@return  float