33template <
class Number =
int,
class Label = NoLabel>
38template <
class Number>
41template <
class Number,
class Label>
50 template <
class Label>
51 inline constexpr bool has_label_v = !std::same_as<Label, NoLabel>;
68 template <
class Label>
70 [[no_unique_address]]
mutable Label value_{};
72 constexpr LabelStorage() =
default;
75 requires(std::constructible_from<Label, A&&>)
76 constexpr LabelStorage(A&& label) : value_(std::forward<A>(label)) {}
82 constexpr LabelStorage() =
default;
83 constexpr LabelStorage(
NoLabel) {}
93 template <
class TargetLabel,
class SourceLabel>
94 inline constexpr bool can_copy_label_v =
95 !has_label_v<TargetLabel> ||
96 (has_label_v<SourceLabel> && std::constructible_from<TargetLabel, const SourceLabel&>) ||
97 (!has_label_v<SourceLabel> && std::default_initializable<TargetLabel>);
108 template <
class TargetLabel,
class OtherPo
int>
109 constexpr auto copyLabel(
const OtherPoint& other) {
110 if constexpr (!has_label_v<TargetLabel>) {
112 }
else if constexpr (!has_label_v<typename OtherPoint::LabelType>) {
113 return TargetLabel{};
115 return TargetLabel(other.label());
128template <
class TNumber,
class TLabel>
164 template <
class X,
class Y,
class A>
165 requires(std::constructible_from<NumberType, const X&> &&
166 std::constructible_from<NumberType, const Y&> &&
167 std::constructible_from<LabelType, A&&>)
170 label_(std::forward<A>(
label)) {}
179 template <Po
intConcept OtherPo
int>
181 constexpr Point(
const OtherPoint& other)
186 label_(detail::copyLabel<
LabelType>(other)) {}
221 template <
class A = LabelType>
222 requires(detail::has_label_v<A>)
224 return label_.value_;
235 return coords_[
index];
240 return coords_[
index];
246 static constexpr std::size_t
size() {
255 const std::ptrdiff_t n =
static_cast<std::ptrdiff_t
>(
size());
256 return (*
this)[
static_cast<std::size_t
>(((
index % n) + n) % n)];
259 const std::ptrdiff_t n =
static_cast<std::ptrdiff_t
>(
size());
260 return (*
this)[
static_cast<std::size_t
>(((
index % n) + n) % n)];
268 for (std::ptrdiff_t i = 0; i < static_cast<std::ptrdiff_t>(
size()); ++i) {
269 if ((*
this)[
static_cast<std::size_t
>(i)] == value) {
282 return coords_.begin();
285 return coords_.cbegin();
294 return coords_.cbegin();
303 return coords_.end();
305 constexpr auto end()
const {
306 return coords_.cend();
315 return coords_.cend();
331 template<Po
intConcept OtherPo
int>
332 [[nodiscard]]
constexpr bool operator==(
const OtherPoint& other)
const;
335 template<AnyShapeConcept OtherShape>
336 [[nodiscard]]
constexpr bool samePointSet(
const OtherShape& other)
const;
344 template<Po
intConcept OtherPo
int>
345 [[nodiscard]]
constexpr std::strong_ordering
operator<=>(
const OtherPoint& other)
const;
360 template <std::
floating_po
int ResultNumber =
double>
368 [[nodiscard]]
constexpr std::array<Point, 1>
vertices()
const;
384 [[nodiscard]]
constexpr std::array<Segment<Point>, 0>
edges()
const;
391 [[nodiscard]]
constexpr std::array<OrientedSegment<Point>, 0>
orientedEdges()
const;
403 template<Po
intConcept OtherPo
int>
404 [[nodiscard]]
constexpr bool contains(
const OtherPoint& other)
const;
407 template<SegmentConcept OtherSegment>
408 [[nodiscard]]
constexpr bool contains(
const OtherSegment& other)
const;
411 template<OrientedSegmentConcept OtherOrientedSegment>
412 [[nodiscard]]
constexpr bool contains(
const OtherOrientedSegment& other)
const;
415 template<LineConcept OtherLine>
416 [[nodiscard]]
constexpr bool contains(
const OtherLine& other)
const;
419 template<OrientedLineConcept OtherOrientedLine>
420 [[nodiscard]]
constexpr bool contains(
const OtherOrientedLine& other)
const;
423 template<RayConcept OtherRay>
424 [[nodiscard]]
constexpr bool contains(
const OtherRay& other)
const;
427 template<HalfplaneConcept OtherHalfplane>
428 [[nodiscard]]
constexpr bool contains(
const OtherHalfplane& other)
const;
431 template<RectangleConcept OtherRectangle>
432 [[nodiscard]]
constexpr bool contains(
const OtherRectangle& other)
const;
435 template<TriangleConcept OtherTriangle>
436 [[nodiscard]]
constexpr bool contains(
const OtherTriangle& other)
const;
439 template<ConvexConcept OtherConvex>
440 [[nodiscard]]
constexpr bool contains(
const OtherConvex& other)
const;
443 template<PolygonConcept OtherPolygon>
444 [[nodiscard]]
constexpr bool contains(
const OtherPolygon& other)
const;
447 template<DiskConcept OtherDisk>
448 [[nodiscard]]
constexpr bool contains(
const OtherDisk& other)
const;
460 template <
class EmptyPo
int>
465 template <
class EmptyPo
int>
470 template <
class EmptyPo
int>
482 template<Po
intConcept OtherPo
int>
486 template<SegmentConcept OtherSegment>
490 template<OrientedSegmentConcept OtherOrientedSegment>
494 template<LineConcept OtherLine>
498 template<OrientedLineConcept OtherOrientedLine>
502 template<RayConcept OtherRay>
506 template<HalfplaneConcept OtherHalfplane>
510 template<RectangleConcept OtherRectangle>
514 template<TriangleConcept OtherTriangle>
528 template<Po
intConcept OtherPo
int>
532 template<SegmentConcept OtherSegment>
536 template<OrientedSegmentConcept OtherOrientedSegment>
540 template<LineConcept OtherLine>
544 template<OrientedLineConcept OtherOrientedLine>
548 template<RayConcept OtherRay>
552 template<HalfplaneConcept OtherHalfplane>
556 template<RectangleConcept OtherRectangle>
560 template<TriangleConcept OtherTriangle>
564 template<ConvexConcept OtherConvex>
568 template<PolygonConcept OtherPolygon>
572 template<DiskConcept OtherDisk>
577 template<DiskConcept OtherDisk>
581 template<ConvexConcept OtherConvex>
585 template<PolygonConcept OtherPolygon>
589 template<Po
intConcept OtherPo
int>
590 [[nodiscard]]
constexpr bool separates(
const OtherPoint& other)
const;
593 template<HalfplaneConcept OtherHalfplane>
594 [[nodiscard]]
constexpr bool separates(
const OtherHalfplane& other)
const;
597 template<RectangleConcept OtherRectangle>
598 [[nodiscard]]
constexpr bool separates(
const OtherRectangle& other)
const;
601 template<TriangleConcept OtherTriangle>
602 [[nodiscard]]
constexpr bool separates(
const OtherTriangle& other)
const;
605 template<DiskConcept OtherDisk>
606 [[nodiscard]]
constexpr bool separates(
const OtherDisk& other)
const;
609 template<ConvexConcept OtherConvex>
610 [[nodiscard]]
constexpr bool separates(
const OtherConvex& other)
const;
613 template<PolygonConcept OtherPolygon>
614 [[nodiscard]]
constexpr bool separates(
const OtherPolygon& other)
const;
617 template<MonotoneChainConcept OtherChain>
618 [[nodiscard]]
constexpr bool contains(
const OtherChain& other)
const;
621 template<MonotoneChainConcept OtherChain>
625 template<MonotoneChainConcept OtherChain>
629 template<MonotoneChainConcept OtherChain>
630 [[nodiscard]]
constexpr bool separates(
const OtherChain& other)
const;
633 template<PolylineConcept OtherPolyline>
634 [[nodiscard]]
constexpr bool contains(
const OtherPolyline& other)
const;
637 template<PolylineConcept OtherPolyline>
641 template<PolylineConcept OtherPolyline>
645 template<PolylineConcept OtherPolyline>
646 [[nodiscard]]
constexpr bool separates(
const OtherPolyline& other)
const;
649 template<HalfplaneIntersectionConcept OtherRegion>
650 [[nodiscard]]
constexpr bool contains(
const OtherRegion& other)
const;
653 template<HalfplaneIntersectionConcept OtherRegion>
657 template<HalfplaneIntersectionConcept OtherRegion>
661 template<HalfplaneIntersectionConcept OtherRegion>
662 [[nodiscard]]
constexpr bool separates(
const OtherRegion& other)
const;
671 template<PolygonWithHolesConcept OtherRegion>
672 [[nodiscard]]
constexpr bool contains(
const OtherRegion& other)
const;
680 template<PolygonWithHolesConcept OtherRegion>
684 template<PolygonWithHolesConcept OtherRegion>
694 template<PolygonWithHolesConcept OtherRegion>
695 [[nodiscard]]
bool separates(
const OtherRegion& other)
const;
706 template<PolygonSetConcept OtherSet>
707 [[nodiscard]]
constexpr bool contains(
const OtherSet& other)
const {
708 for (
const auto& component : other) {
717 template<PolygonSetConcept OtherSet>
719 for (
const auto& component : other) {
728 template<PolygonSetConcept OtherSet>
730 for (
const auto& component : other) {
746 template<PolygonSetConcept OtherSet>
747 [[nodiscard]]
bool separates(
const OtherSet& other)
const;
755 template<Po
intConcept OtherPo
int>
756 [[nodiscard]]
constexpr bool intersects(
const OtherPoint& other)
const;
762 template<
typename OtherShape>
764 [[nodiscard]]
constexpr bool intersects(
const OtherShape& other)
const {
765 return other.intersects(*
this);
769 template <
class EmptyPo
int>
775 template<Po
intConcept OtherPo
int>
782 template<
typename OtherShape>
785 return other.interiorsIntersect(*
this);
789 template <
class EmptyPo
int>
795 template<SegmentConcept OtherSegment>
796 [[nodiscard]]
constexpr bool separates(
const OtherSegment& other)
const;
799 template<OrientedSegmentConcept OtherOrientedSegment>
800 [[nodiscard]]
constexpr bool separates(
const OtherOrientedSegment& other)
const;
803 template<LineConcept OtherLine>
804 [[nodiscard]]
constexpr bool separates(
const OtherLine& other)
const;
807 template<OrientedLineConcept OtherOrientedLine>
808 [[nodiscard]]
constexpr bool separates(
const OtherOrientedLine& other)
const;
811 template<RayConcept OtherRay>
812 [[nodiscard]]
constexpr bool separates(
const OtherRay& other)
const;
815 template<Po
intConcept OtherPo
int>
816 [[nodiscard]]
constexpr bool crosses(
const OtherPoint& other)
const;
822 template<
typename OtherShape>
824 [[nodiscard]]
constexpr bool crosses(
const OtherShape& other)
const {
825 return other.crosses(*
this);
829 template <
class EmptyPo
int>
835 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
836 [[nodiscard]]
constexpr std::optional<Point<ResultNumber, LabelType>>
840 template <
class ResultNumber = NumberType,
typename OtherShape>
842 && (detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
843 &&
requires(
const OtherShape& o,
const Point& self) {
846 [[nodiscard]]
constexpr auto intersection(
const OtherShape& other)
const {
851 template <
class ResultNumber = NumberType,
class EmptyPo
int>
868 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
872 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
883 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
885 && (detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
886 &&
requires(
const OtherShape& o,
const Point& self) {
900 template <
class ResultNumber =
double,
class DiskPo
intType,
class DiskLabel>
917 template <
class ResultNumber = NumberType, BoundedPolygonalConcept OtherShape>
918 requires detail::ClosestPairConcept<Point<TNumber, TLabel>, OtherShape>
937 template <
class ResultNumber = division_result_t<NumberType>,
class OtherShape>
938 requires detail::ClosestPointsPairConcept<Point<TNumber, TLabel>, OtherShape>
951 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
960 template <
class ResultNumber = NumberType,
typename OtherShape>
961 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
962 &&
requires(
const OtherShape& o,
const Point& self) {
978 template <
class ApproximateNumber =
double, Po
intConcept OtherPo
int>
979 [[nodiscard]] ApproximateNumber
distance(
const OtherPoint& other)
const;
990 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
991 [[nodiscard]]
constexpr auto distanceL1(
const OtherPoint& other)
const;
994 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
995 [[nodiscard]]
constexpr auto distanceL1(
const OtherRectangle& other)
const {
1005 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1008 && (detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
1009 &&
requires(
const OtherShape& o,
const Point& self) {
1012 [[nodiscard]]
constexpr auto distanceL1(
const OtherShape& other)
const {
1031 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1046 template <
class ResultNumber =
double, Po
intConcept OtherPo
int>
1060 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1064 template <
class ResultNumber = NumberType, RectangleConcept OtherRectangle>
1065 [[nodiscard]]
constexpr auto distanceLInf(
const OtherRectangle& other)
const {
1075 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1078 && (detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
1079 &&
requires(
const OtherShape& o,
const Point& self) {
1087 template <
class ResultNumber =
double, Po
intConcept OtherPo
int>
1097 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1106 template <
class ResultNumber = NumberType,
typename OtherShape>
1108 && (detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
1109 &&
requires(
const OtherShape& o,
const Point& self) {
1117 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1127 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1136 template <
class ResultNumber = NumberType,
typename OtherShape>
1138 && (detail::shapeRank<OtherShape> > detail::shapeRank<Point>)
1139 &&
requires(
const OtherShape& o,
const Point& self) {
1147 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1159 template <
class ResultNumber =
double,
class DiskPo
intType,
class DiskLabel>
1165 template <
class ResultNumber =
double,
class DiskPo
intType,
class DiskLabel>
1183 template <
class OtherShape>
1209 template <
class OtherShape>
1222 template<Po
intConcept OtherPo
int>
1234 template<Po
intConcept OtherPo
int>
1245 template <
class OtherNumber>
1256 template <
class OtherNumber>
1288 template <
class OtherNumber>
1297 template <
class OtherNumber>
1307 template <
class OtherNumber>
1316 template <
class OtherNumber>
1326 template <
class OtherNumber>
1335 template <
class OtherNumber>
1345 template <
class OtherNumber>
1354 template <
class OtherNumber>
1375 template<
class ResultNumber = NumberType>
1385 template<
class ResultNumber = division_result_t<NumberType>>
1389 std::array<NumberType,2> coords_{};
1390 [[no_unique_address]] detail::LabelStorage<LabelType> label_{};
1404template <
class LeftNumber,
class LeftLabel,
class RightNumber,
class RightLabel>
1417template <
class Number,
class Label,
class Scalar>
1419[[nodiscard]]
constexpr auto operator*(
const Point<Number, Label>& point,
const Scalar& scalar);
1431template <
class Scalar,
class Number,
class Label>
1433[[nodiscard]]
constexpr auto operator*(
const Scalar& scalar,
const Point<Number, Label>& point);
1446template <
class LeftNumber,
class LeftLabel,
class RightNumber,
class RightLabel>
1459template <
class Number,
class Label,
class Scalar>
1461[[nodiscard]]
constexpr auto operator/(
const Point<Number, Label>& point,
const Scalar& scalar);
1472template <
class Number,
class Label>
Shape pairs whose Minkowski sum Pangolin can represent.
Definition forward.hpp:476
Definition forward.hpp:306
Definition forward.hpp:313
Definition arrangement.hpp:67
constexpr auto operator-(const Point< LeftNumber, LeftLabel > &left, const Point< RightNumber, RightLabel > &right)
Translates a point by the opposite of another point.
Definition transformations.hpp:130
Convex() -> Convex< Point<>, NoLabel >
Definition convex.hpp:3311
std::ostream & operator<<(std::ostream &stream, const Point< Number, Label > &point)
Streams a point as (x,y) or label:(x,y).
Definition io.hpp:27
constexpr auto operator*(const Transformation< Number > &transformation, const ShapeT &shape)
Applies a transformation to any supported shape.
Definition transformations.hpp:2200
Closed convex polygon stored by its vertices.
Definition convex.hpp:170
Closed Euclidean disk stored by boundary points plus optional disk label.
Definition disk.hpp:66
The empty set of points in the plane.
Definition emptyshape.hpp:33
Intersection of closed half-planes; convex but possibly unbounded or empty.
Definition halfplaneintersection.hpp:244
Unoriented infinite line.
Definition line.hpp:52
Sentinel type used when a point carries no extra label.
Definition point.hpp:31
Two-dimensional point with optional label payload.
Definition point.hpp:129
constexpr auto closestPoints(const OtherShape &other) const
Returns the pair of points realizing the distance, nothing when the shapes meet.
Definition closest.hpp:307
constexpr void scaleUpX(const OtherNumber scalar)
Multiplies the point's x-coordinate by a scalar in place.
Definition transformations.hpp:87
constexpr auto end() const
Definition point.hpp:305
bool separates(const OtherSet &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:5909
constexpr Point(const X &x, const Y &y, A &&label)
Creates a point from its coordinates and label.
Definition point.hpp:168
detail::floating_result_t< ResultNumber > distanceL1(const Disk< DiskPointType, DiskLabel > &disk) const
Returns the Manhattan (L1) distance to a disk.
Definition point.hpp:1160
constexpr Point rotated90(int k=1) const
Returns the point rotated by 90k degrees around the origin.
Definition transformations.hpp:61
constexpr bool interiorsIntersect(const OtherPoint &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:24
constexpr auto distanceL1(const OtherRectangle &other) const
Returns the Manhattan distance to an axis-aligned rectangle without division.
Definition point.hpp:995
constexpr auto intersection(const Shape< OtherPoint > &other) const
Returns the intersection of the two shapes (A ∩ B), re-dispatching through the wrapper's own intersec...
Definition point.hpp:1032
constexpr Point()=default
Creates the origin point (0, 0).
constexpr bool interiorsIntersect(const OtherShape &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition point.hpp:784
constexpr bool interiorContains(const OtherPolyline &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1674
ApproximateNumber distance(const OtherPoint &other) const
Returns the Euclidean distance to another point.
Definition distance.hpp:69
constexpr bool contains(const OtherOrientedSegment &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:39
constexpr auto squaredHausdorffDistance(const OtherShape &other) const
Returns the squared Hausdorff distance to the given shape.
Definition point.hpp:965
constexpr bool boundaryContains(const OtherSegment &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:32
constexpr bool operator==(const OtherPoint &other) const
Tests coordinate equality.
Definition predicates.hpp:30
constexpr void scaleDownX(const OtherNumber scalar)
Divides the point's x-coordinate by a scalar in place.
Definition transformations.hpp:111
constexpr bool contains(const OtherOrientedLine &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:51
constexpr bool boundaryContains(const OtherChain &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1178
constexpr const NumberType & get(std::ptrdiff_t index) const
Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the en...
Definition point.hpp:254
constexpr bool boundaryContains(const OtherRay &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:56
constexpr bool crosses(const OtherPoint &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:25
constexpr bool boundaryContains(const OtherOrientedSegment &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:38
constexpr EmptyShape< EmptyPoint > intersection(const EmptyShape< EmptyPoint > &) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition point.hpp:852
constexpr bool interiorContains(const OtherLine &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:42
constexpr bool boundaryContains(const OtherOrientedLine &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:50
constexpr bool contains(const OtherRectangle &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:69
constexpr Point swapped() const
Returns the point with x and y swapped.
Definition transformations.hpp:56
constexpr auto distanceL1(const OtherShape &other) const
Returns the Manhattan distance to the given shape.
Definition point.hpp:1012
constexpr bool intersects(const EmptyShape< EmptyPoint > &) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition point.hpp:770
constexpr bool interiorContains(const OtherRegion &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
constexpr bool separates(const OtherLine &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:240
constexpr bool contains(const OtherConvex &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:87
constexpr bool contains(const OtherDisk &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:93
constexpr bool contains(const OtherRegion &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2713
constexpr bool boundaryContains(const OtherSet &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition point.hpp:718
constexpr Point operator-() const
Returns the point mirrored through the origin.
Definition transformations.hpp:19
constexpr bool interiorContains(const OtherTriangle &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:77
constexpr Convex< Point > convexHull() const
Returns the convex hull of the point.
Definition point.hpp:375
constexpr bool boundaryContains(const OtherPolyline &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1287
constexpr auto begin()
Returns an iterator to the first coordinate.
Definition point.hpp:281
constexpr auto distanceLInf(const OtherPoint &other) const
Returns the Chebyshev distance to another point.
Definition distance.hpp:83
constexpr auto squaredHausdorffDistance(const OtherPoint &other) const
Returns the squared Hausdorff distance to another point.
Definition distance.hpp:91
constexpr bool separates(const OtherRectangle &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:286
constexpr void scaleDownY(const OtherNumber scalar)
Divides the point's y-coordinate by a scalar in place.
Definition transformations.hpp:123
constexpr bool boundaryContains(const OtherRegion &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1626
constexpr bool interiorContains(const OtherChain &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1450
constexpr std::optional< Point< ResultNumber, LabelType > > intersection(const OtherPoint &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
constexpr bool separates(const OtherPolyline &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:3487
constexpr bool separates(const OtherRegion &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:4552
constexpr Point scaledUpX(const OtherNumber scalar) const
Returns the point with its x-coordinate multiplied by a scalar.
constexpr A & label() const
Definition point.hpp:223
constexpr Point scaledDownX(const OtherNumber scalar) const
Returns the point with its x-coordinate divided by a scalar.
constexpr bool separates(const OtherConvex &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:279
constexpr Point & operator/=(const OtherNumber scalar)
Scales a point by a scalar division in place.
constexpr bool interiorContains(const OtherDisk &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:95
constexpr bool contains(const OtherPolygon &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:1695
constexpr Point & operator-=(const OtherPoint &other)
Translates a point by the opposite of another point in place.
constexpr auto minkowskiErosion(const OtherShape &other) const
Returns the Minkowski erosion of this shape by another (A ⊖ B).
Definition minkowskierosion.hpp:648
constexpr auto squaredDistance(const OtherPoint &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:61
constexpr bool interiorContains(const OtherPolygon &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:89
constexpr bool contains(const OtherSegment &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:33
constexpr auto cend() const
Returns an iterator past the last coordinate.
Definition point.hpp:314
constexpr bool interiorsIntersect(const Shape< Point< TNumber, TLabel > > &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
constexpr Point(const OtherPoint &other)
Converts a point with different coordinate and label types.
Definition point.hpp:181
constexpr bool contains(const OtherSet &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition point.hpp:707
constexpr bool boundaryContains(const OtherDisk &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:97
NumberType & operator[](std::size_t index)
Returns coordinate 0 for x and 1 for y.
Definition point.hpp:238
constexpr bool intersects(const Shape< Point< TNumber, TLabel > > &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
static constexpr std::size_t size()
Returns the number of coordinates (always 2).
Definition point.hpp:246
constexpr std::array< Point, 1 > vertices() const
Returns the unique vertex of the point-shaped object.
Definition bounding.hpp:34
constexpr Line< Point< ResultNumber, LabelType > > dual() const
Returns the dual Line.
constexpr auto distanceLInf(const Shape< OtherPoint > &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition point.hpp:1088
constexpr bool contains(const OtherHalfplane &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:63
constexpr bool boundaryContains(const OtherRectangle &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:68
constexpr bool boundaryContains(const OtherLine &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:44
constexpr auto intersection(const OtherShape &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition point.hpp:846
constexpr bool boundaryContains(const OtherPoint &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:26
constexpr bool boundaryContains(const OtherConvex &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:85
constexpr auto begin() const
Definition point.hpp:284
constexpr auto minkowskiSum(const OtherShape &other) const
Returns the Minkowski sum of this shape and another (A ⊕ B).
Definition minkowski.hpp:874
constexpr auto distanceL1(const Shape< OtherPoint > &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition point.hpp:1047
constexpr bool interiorContains(const OtherPoint &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:24
constexpr bool separates(const OtherPolygon &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:302
constexpr bool interiorContains(const OtherRectangle &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:66
constexpr void scaleUpY(const OtherNumber scalar)
Multiplies the point's y-coordinate by a scalar in place.
Definition transformations.hpp:99
constexpr Rectangle< Point< ResultNumber > > fbox() const
Returns a floating-point bounding box containing the point.
Definition bounding.hpp:24
constexpr bool boundaryContains(const OtherPolygon &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:91
constexpr HalfplaneIntersection< Point< NumberType, LabelType > > asHalfplaneIntersection() const
Returns the point as a (degenerate) half-plane intersection.
Definition point.hpp:1365
constexpr bool crosses(const OtherShape &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition point.hpp:824
constexpr bool boundaryContains(const OtherHalfplane &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:62
constexpr bool intersects(const OtherPoint &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:25
constexpr bool separates(const OtherRay &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:252
constexpr std::ptrdiff_t index(const NumberType &value) const
Definition point.hpp:267
constexpr Point & operator*=(const OtherNumber scalar)
Scales a point by a scalar in place.
constexpr auto hausdorffDistanceL1(const Shape< OtherPoint > &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition point.hpp:1118
constexpr bool contains(const OtherChain &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:1993
constexpr bool contains(const OtherLine &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:45
constexpr std::array< OrientedSegment< Point >, 0 > orientedEdges() const
Returns the oriented boundary edges.
Definition bounding.hpp:44
constexpr bool separates(const OtherHalfplane &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:264
constexpr Rectangle< Point > bbox() const
Returns the bounding box of the point.
Definition bounding.hpp:18
constexpr Point & operator+=(const OtherPoint &other)
Translates a point by another point in place.
constexpr const NumberType & operator[](std::size_t index) const
Returns coordinate 0 for x and 1 for y.
Definition point.hpp:233
detail::floating_result_t< ResultNumber > distanceLInf(const Disk< DiskPointType, DiskLabel > &disk) const
Returns the Chebyshev (LInf) distance to a disk.
Definition point.hpp:1166
constexpr void rotate90(int k=1)
Rotates the point by 90k degrees around the origin in place.
Definition transformations.hpp:71
constexpr std::array< Segment< Point >, 0 > edges() const
Returns the point boundary edges.
Definition bounding.hpp:39
constexpr bool interiorContains(const OtherRegion &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:2038
constexpr bool interiorContains(const OtherSet &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition point.hpp:729
constexpr bool contains(const OtherPoint &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:25
constexpr bool separates(const OtherOrientedLine &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:246
constexpr auto end()
Returns an iterator past the last coordinate.
Definition point.hpp:302
constexpr bool contains(const OtherPolyline &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2351
constexpr bool separates(const OtherPoint &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:258
constexpr bool separates(const OtherChain &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:3142
constexpr auto distanceLInf(const OtherRectangle &other) const
Returns the Chebyshev distance to an axis-aligned rectangle without division.
Definition point.hpp:1065
constexpr bool contains(const OtherRay &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:57
constexpr bool boundaryContains(const OtherRegion &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
constexpr bool contains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition point.hpp:461
constexpr bool interiorsIntersect(const EmptyShape< EmptyPoint > &) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition point.hpp:790
constexpr bool interiorContains(const OtherOrientedSegment &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:36
constexpr bool crosses(const Shape< Point< TNumber, TLabel > > &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
constexpr bool boundaryContains(const Shape< Point< TNumber, TLabel > > &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
constexpr bool separates(const OtherOrientedSegment &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:234
constexpr bool contains(const Shape< Point< TNumber, TLabel > > &other) const
Tests whether this shape contains the other shape (A ⊇ B).
constexpr bool interiorContains(const OtherConvex &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:83
constexpr bool interiorContains(const OtherRay &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:54
constexpr bool intersects(const OtherShape &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition point.hpp:764
TLabel LabelType
Definition point.hpp:133
constexpr bool separates(const OtherSegment &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:228
constexpr auto hausdorffDistanceLInf(const OtherShape &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition point.hpp:1142
detail::floating_result_t< ResultNumber > squaredDistance(const Disk< DiskPointType, DiskLabel > &disk) const
Returns the squared Euclidean distance to a disk.
Definition point.hpp:901
constexpr bool samePointSet(const OtherShape &other) const
Tests whether another shape defines exactly the same point set.
Definition samepointset.hpp:1935
constexpr auto cbegin() const
Returns an iterator to the first coordinate.
Definition point.hpp:293
bool separates(const OtherRegion &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:5630
constexpr auto hausdorffDistanceL1(const OtherShape &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition point.hpp:1112
constexpr const NumberType & x() const
Definition point.hpp:193
constexpr bool contains(const OtherRegion &other) const
Tests whether this shape contains the other shape (A ⊇ B).
constexpr bool contains(const OtherTriangle &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:80
constexpr auto squaredDistance(const OtherShape &other) const
Returns the squared Euclidean distance to the given shape.
Definition point.hpp:889
NumberType & y()
Definition point.hpp:208
constexpr const NumberType & y() const
Definition point.hpp:205
constexpr Line< Point< ResultNumber, LabelType > > polar() const
Returns the polar Line.
constexpr auto hausdorffDistanceL1(const OtherPoint &other) const
Returns the Manhattan (L1) Hausdorff distance to another point.
Definition distancel1.hpp:194
constexpr Point(NumberType x, NumberType y)
Creates a point from its x and y coordinates.
Definition point.hpp:146
constexpr auto hausdorffDistanceLInf(const Shape< OtherPoint > &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition point.hpp:1148
constexpr bool crosses(const EmptyShape< EmptyPoint > &) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition point.hpp:830
constexpr bool boundaryContains(const OtherTriangle &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:79
constexpr bool interiorContains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition point.hpp:471
constexpr bool boundaryContains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition point.hpp:466
constexpr bool separates(const OtherTriangle &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:296
constexpr auto squaredDistance(const OtherRectangle &other) const
Returns the squared distance to an axis-aligned rectangle without division.
Definition point.hpp:873
constexpr bool interiorContains(const OtherOrientedLine &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:48
constexpr auto distanceLInf(const OtherShape &other) const
Returns the Chebyshev distance to the given shape.
Definition point.hpp:1082
constexpr auto distanceL1(const OtherPoint &other) const
Returns the Manhattan distance to another point.
Definition distance.hpp:75
constexpr std::strong_ordering operator<=>(const OtherPoint &other) const
Provides lexicographic ordering on (x, y).
Definition predicates.hpp:38
constexpr bool interiorContains(const OtherHalfplane &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:60
constexpr bool separates(const OtherDisk &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:270
constexpr Point scaledDownY(const OtherNumber scalar) const
Returns the point with its y-coordinate divided by a scalar.
constexpr bool interiorContains(const OtherSegment &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:30
constexpr auto closestSegments(const OtherShape &other) const
Returns the pair of elements realizing the distance, nothing when the shapes meet.
Definition closest.hpp:300
WorkNumber NumberType
Definition point.hpp:131
constexpr Point scaledUpY(const OtherNumber scalar) const
Returns the point with its y-coordinate multiplied by a scalar.
constexpr auto hausdorffDistanceLInf(const OtherPoint &other) const
Returns the Chebyshev (LInf) Hausdorff distance to another point.
Definition distancelinf.hpp:182
constexpr NumberType & get(std::ptrdiff_t index)
Definition point.hpp:258
NumberType & x()
Definition point.hpp:196
Axis-aligned rectangle stored by minimum and maximum corners.
Definition rectangle.hpp:75
Runtime variant wrapper over the supported primitive shapes.
Definition shape.hpp:160