public function getLength(DistanceInterface $calculator): float
    {
        return $calculator->getDistance($this->point1, $this->point2);
    }
public function getLength(DistanceInterface $calculator): float
    {
        return $calculator->getDistance($this->point1, $this->point2);
    }
public function getLength ( DistanceInterface $ calculator ) : float { return $ calculator -> getDistance ( $ this -> point1 , $ this -> point2 ) ; }
Calculates the length of the line (distance between the two
coordinates).

@param DistanceInterface $calculator instance of distance calculation class

@return float
Calculates the length of the line ( distance between the two coordinates ) .