/** * Check if there is point with given coordinates * @param Point $pointToCheck */ public function hasPoint(PointInterface $pointToCheck) { $existingPoint = $this->getPointByCoordinates($pointToCheck->getX(), $pointToCheck->getY()); if ($existingPoint) { return true; } return false; }
/** * Indicates whether some other Point is equal to this one * * @param PointInterface $point other Point * @return bool true if this Point is the equal to some other Point; false otherwise */ public function equals(PointInterface $point) : bool { return $this->x() === $point->x() && $this->y() === $point->y(); }