|
@@ -0,0 +1,34 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: mrs
|
|
|
+ * Date: 28.12.2017
|
|
|
+ * Time: 9:27
|
|
|
+ */
|
|
|
+require_once('AbstractCoordinates.php');
|
|
|
+
|
|
|
+
|
|
|
+class Point extends Coordinates
|
|
|
+{
|
|
|
+ public $x = 0;
|
|
|
+ public $y = 0;
|
|
|
+
|
|
|
+ public function __construct(int $x, int $y)
|
|
|
+ {
|
|
|
+
|
|
|
+ $this->x = $x;
|
|
|
+ $this->y = $y;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getCoordinates(): array
|
|
|
+ {
|
|
|
+ $point['x'] = $this->x;
|
|
|
+ $point['y'] = $this->y;
|
|
|
+ return $point;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function printCoordinates(): void
|
|
|
+ {
|
|
|
+ echo "Координаты точки: х = " . $this->x . " y = " . $this->y;
|
|
|
+ }
|
|
|
+}
|