Lines Matching refs:point

42                         'Cannot create Polygon: contains non-closed ring (first point: '
43 . implode(' ', $component->startPoint()->asArray()) . ', last point: '
163 foreach ($points as $k => $point) {
165 $P = ($point->x() * $points[$j]->y()) - ($point->y() * $points[$j]->x());
166 $x += ($point->x() + $points[$j]->x()) * $P;
167 $y += ($point->y() + $points[$j]->y()) * $P;
173 * Find the outermost point from the centroid
175 * @returns Point The outermost point
187 foreach ($this->exteriorRing()->getPoints() as $point) {
188 $distance = $centroid->distance($point);
192 $maxPoint = $point;
248 * For a given point, determine whether it's bounded by the given polygon.
253 * @param Point $point
258 public function pointInPolygon($point, $pointOnBoundary = true, $pointOnVertex = true)
262 // Check if the point sits exactly on a vertex
263 if ($this->pointOnVertex($point, $vertices)) {
267 // Check if the point is inside the polygon or on the boundary
275 && $vertex1->y() == $point->y()
276 && $point->x() > min($vertex1->x(), $vertex2->x())
277 && $point->x() < max($vertex1->x(), $vertex2->x())
279 // Check if point is on an horizontal polygon boundary
283 $point->y() > min($vertex1->y(), $vertex2->y())
284 && $point->y() <= max($vertex1->y(), $vertex2->y())
285 && $point->x() <= max($vertex1->x(), $vertex2->x())
289 ($point->y() - $vertex1->y()) * ($vertex2->x() - $vertex1->x())
292 if ($xinters == $point->x()) {
293 // Check if point is on the polygon boundary (other than horizontal)
296 if ($vertex1->x() == $vertex2->x() || $point->x() <= $xinters) {
310 * @param Point $point
313 public function pointOnVertex($point)
316 if ($point->equals($vertex)) {
325 * TODO: rewrite this. Currently supports point, linestring and polygon with only outer ring
341 $isInside = true; // at least one point of the innerPoly is inside the outerPoly