1 | <?php |
||
13 | class Point implements Finite |
||
14 | { |
||
15 | /** @type \Nubs\Vectorix\Vector A vector representing the point. */ |
||
16 | protected $_vector; |
||
17 | |||
18 | /** |
||
19 | * Initalize the point from a vector. |
||
20 | * |
||
21 | * @api |
||
22 | * @param \Nubs\Vectorix\Vector $vector The vector representing the point's terms. |
||
23 | */ |
||
24 | public function __construct(Vector $vector) |
||
28 | |||
29 | /** |
||
30 | * Creates a point from its terms. |
||
31 | * |
||
32 | * @api |
||
33 | * @param array<int|float> $terms The terms (x, y, z, etc.) of the point. |
||
34 | * @return self The point with the given terms. |
||
35 | */ |
||
36 | public static function createFromTerms(array $terms) |
||
40 | |||
41 | /** |
||
42 | * Get the vector representing the point's location. |
||
43 | * |
||
44 | * @api |
||
45 | * @return \Nubs\Vectorix\Vector The vector representing the point. |
||
46 | */ |
||
47 | public function vector() |
||
51 | |||
52 | /** |
||
53 | * Get the terms of the point. |
||
54 | * |
||
55 | * @api |
||
56 | * @return array<int|float> The terms of the point. |
||
57 | */ |
||
58 | public function terms() |
||
62 | |||
63 | /** |
||
64 | * Get the dimension of the point. |
||
65 | * |
||
66 | * @api |
||
67 | * @return int The dimension of the point. |
||
68 | */ |
||
69 | public function dimension() |
||
73 | |||
74 | /** |
||
75 | * Check whether the given point is the same as this point. |
||
76 | * |
||
77 | * @api |
||
78 | * @param self $b The point to check for equality. |
||
79 | * @return bool True if the points are equal and false otherwise. |
||
80 | */ |
||
81 | public function isEqual(self $b) |
||
85 | |||
86 | /** |
||
87 | * Check whether the given point belongs to the same geometric space as this |
||
88 | * point. |
||
89 | * |
||
90 | * @api |
||
91 | * @param self $b The point to check. |
||
92 | * @return bool True if the points are in the same geometric space and false otherwise. |
||
93 | */ |
||
94 | public function isSameSpace(self $b) |
||
98 | |||
99 | /** |
||
100 | * The center of the point is just the point itself. |
||
101 | * |
||
102 | * @api |
||
103 | * @return \Nubs\Geometron\Point This point. |
||
104 | * @see \Nubs\Geometron\Finite::center() |
||
105 | */ |
||
106 | public function center() |
||
110 | } |
||
111 |