| 1 | <?php |
||
| 20 | class Point implements PointInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Coordinate x |
||
| 24 | * |
||
| 25 | * @var float coordinate X |
||
| 26 | */ |
||
| 27 | private $x; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Coordinate y |
||
| 31 | * |
||
| 32 | * @var float coordinate y |
||
| 33 | */ |
||
| 34 | private $y; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Point |
||
| 38 | * |
||
| 39 | * @param float $x coordinate x |
||
| 40 | * @param float $y coordinate y |
||
| 41 | */ |
||
| 42 | public function __construct(float $x, float $y) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get x |
||
| 50 | * |
||
| 51 | * @return float coordinate x |
||
| 52 | */ |
||
| 53 | public function x(): float |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get y |
||
| 60 | * |
||
| 61 | * @return float coordinate y |
||
| 62 | */ |
||
| 63 | public function y(): float |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Indicates whether some other Point is equal to this one |
||
| 70 | * |
||
| 71 | * @param PointInterface $point other Point |
||
| 72 | * @return bool true if this Point is the equal to some other Point; false otherwise |
||
| 73 | */ |
||
| 74 | public function equals(PointInterface $point): bool |
||
| 78 | } |
||
| 79 |