29template <
class Po
intType = Po
int<>,
class Label>
34template <
class Po
intType>
37template <
class Po
intType,
class A>
40template <
class Number>
57template <
class TPo
int,
class TLabel>
63 static_assert(detail::is_point_v<PointType>,
"Segment requires pgl::Point endpoints");
80 std::swap(first, second);
82 points_[0] = std::move(first);
83 points_[1] = std::move(second);
108 requires(detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
110 :
Segment(std::move(first), std::move(second)) {
111 label_ = std::forward<A>(
label);
116 requires(detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
126 template<Po
intConcept OtherPo
intType,
class OtherLabelType>
127 requires(std::constructible_from<PointType, const OtherPointType&>)
130 label_ = detail::copyLabel<LabelType>(other);
136 template<Po
intConcept OtherPo
intType,
class OtherLabelType>
137 requires(std::constructible_from<PointType, const OtherPointType&>)
141 label_ = detail::copyLabel<LabelType>(other);
153 return points_[
index];
159 static constexpr std::size_t
size() {
168 const std::ptrdiff_t n =
static_cast<std::ptrdiff_t
>(
size());
169 return (*
this)[
static_cast<std::size_t
>(((
index % n) + n) % n)];
177 for (std::ptrdiff_t i = 0; i < static_cast<std::ptrdiff_t>(
size()); ++i) {
178 if ((*
this)[
static_cast<std::size_t
>(i)] == point) {
209 return points_.cbegin();
218 return points_.cbegin();
226 constexpr auto end()
const {
227 return points_.cend();
236 return points_.cend();
246 return points_ == other.points_;
250 template<AnyShapeConcept OtherShape>
251 [[nodiscard]]
constexpr bool samePointSet(
const OtherShape& other)
const;
262 return points_ <=> other.points_;
273 template <
class A = LabelType>
274 requires(detail::has_label_v<A>)
331 template <
class OtherNumber>
335 template <
class OtherNumber>
339 template <
class OtherNumber>
343 template <
class OtherNumber>
347 template <
class OtherNumber>
351 template <
class OtherNumber>
355 template <
class OtherNumber>
359 template <
class OtherNumber>
389 [[nodiscard]]
constexpr std::optional<PointType>
getIfPoint()
const;
427 template <
class ResultNumber = NumberType>
428 [[nodiscard]]
constexpr ResultNumber
area()
const;
452 template <
class ApproximateNumber =
double>
453 [[nodiscard]] ApproximateNumber
length()
const;
477 template<Po
intConcept OtherPo
int>
490 template<Po
intConcept OtherPo
int>
503 template<Po
intConcept OtherPo
int>
519 template<SegmentConcept OtherSegment>
521 return detail::reduceDegenerateToPoint(
525 template<OrientedSegmentConcept OtherOrientedSegment>
527 return detail::reduceDegenerateToPoint(
531 template<LineConcept OtherLine>
534 template<OrientedLineConcept OtherOrientedLine>
535 [[nodiscard]]
constexpr bool boundaryContains(
const OtherOrientedLine&)
const {
return false; }
537 template<RayConcept OtherRay>
540 template<HalfplaneConcept OtherHalfplane>
541 [[nodiscard]]
constexpr bool boundaryContains(
const OtherHalfplane&)
const {
return false; }
543 template<RectangleConcept OtherRectangle>
545 return detail::reduceDegenerateToPoint(
549 template<TriangleConcept OtherTriangle>
551 return detail::reduceDegenerateToPoint(
555 template<ConvexConcept OtherConvex>
557 return detail::reduceDegenerateToPoint(
561 template<PolygonConcept OtherPolygon>
563 return detail::reduceDegenerateToPoint(
567 template<DiskConcept OtherDisk>
569 return detail::reduceDegenerateToPoint(
583 template<Po
intConcept OtherPo
int>
596 template<Po
intConcept OtherPo
int>
597 [[nodiscard]]
constexpr bool contains(
const OtherPoint& point)
const;
606 template<SegmentConcept OtherSegment>
607 [[nodiscard]]
constexpr bool contains(
const OtherSegment& other)
const;
616 template<OrientedSegmentConcept OtherOrientedSegment>
617 [[nodiscard]]
constexpr bool contains(
const OtherOrientedSegment& other)
const;
626 template<LineConcept OtherLine>
627 [[nodiscard]]
constexpr bool contains(
const OtherLine& other)
const;
636 template<OrientedLineConcept OtherOrientedLine>
637 [[nodiscard]]
constexpr bool contains(
const OtherOrientedLine& other)
const;
646 template<RayConcept OtherRay>
647 [[nodiscard]]
constexpr bool contains(
const OtherRay& other)
const;
656 template<HalfplaneConcept OtherHalfplane>
657 [[nodiscard]]
constexpr bool contains(
const OtherHalfplane& other)
const;
666 template<RectangleConcept OtherRectangle>
667 [[nodiscard]]
constexpr bool contains(
const OtherRectangle& other)
const;
676 template<TriangleConcept OtherTriangle>
677 [[nodiscard]]
constexpr bool contains(
const OtherTriangle& other)
const;
688 template<ConvexConcept OtherConvex>
689 [[nodiscard]]
constexpr bool contains(
const OtherConvex& other)
const;
692 template<PolygonConcept OtherPolygon>
693 [[nodiscard]]
constexpr bool contains(
const OtherPolygon& other)
const;
703 template<DiskConcept OtherDisk>
704 [[nodiscard]]
constexpr bool contains(
const OtherDisk& other)
const;
713 template<Po
intConcept OtherPo
int>
717 template<Po
intConcept OtherPo
int>
725 template <
class EmptyPo
int>
730 template <
class EmptyPo
int>
735 template <
class EmptyPo
int>
740 template <
class EmptyPo
int>
752 template<Po
intConcept OtherPo
int>
762 template<SegmentConcept OtherSegment>
772 template<OrientedSegmentConcept OtherOrientedSegment>
782 template<TriangleConcept OtherTriangle>
788 template<LineConcept OtherLine>
791 template<OrientedLineConcept OtherOrientedLine>
792 [[nodiscard]]
constexpr bool interiorContains(
const OtherOrientedLine&)
const {
return false; }
794 template<RayConcept OtherRay>
797 template<HalfplaneConcept OtherHalfplane>
798 [[nodiscard]]
constexpr bool interiorContains(
const OtherHalfplane&)
const {
return false; }
800 template<RectangleConcept OtherRectangle>
802 return detail::reduceDegenerateGuarded(
803 other, [
this](
const auto& carrier) {
return this->
interiorContains(carrier); });
806 template<ConvexConcept OtherConvex>
808 return detail::reduceDegenerateGuarded(
809 other, [
this](
const auto& carrier) {
return this->
interiorContains(carrier); });
812 template<PolygonConcept OtherPolygon>
814 return detail::reduceDegenerate(
815 other, [
this](
const auto& carrier) {
return this->
interiorContains(carrier); });
818 template<DiskConcept OtherDisk>
820 return detail::reduceDegenerate(
821 other, [
this](
const auto& carrier) {
return this->
interiorContains(carrier); });
825 template<Po
intConcept OtherPo
int>
835 template<Po
intConcept OtherPo
int>
836 [[nodiscard]]
constexpr bool collinear(
const OtherPoint& point)
const;
845 template<SegmentConcept OtherSegment>
846 [[nodiscard]]
constexpr bool collinear(
const OtherSegment& other)
const;
855 template<OrientedSegmentConcept OtherOrientedSegment>
856 [[nodiscard]]
constexpr bool collinear(
const OtherOrientedSegment& other)
const;
862 template<LineConcept OtherLine>
863 [[nodiscard]]
constexpr bool collinear(
const OtherLine& other)
const;
869 template<OrientedLineConcept OtherOrientedLine>
870 [[nodiscard]]
constexpr bool collinear(
const OtherOrientedLine& other)
const;
876 template<RayConcept OtherRay>
877 [[nodiscard]]
constexpr bool collinear(
const OtherRay& other)
const;
887 template <
class ResultNumber = division_result_t<NumberType>>
888 [[nodiscard]]
constexpr ResultNumber
slope()
const;
897 template<SegmentConcept OtherSegment>
898 [[nodiscard]]
constexpr bool parallel(
const OtherSegment& other)
const;
907 template<OrientedSegmentConcept OtherOrientedSegment>
908 [[nodiscard]]
constexpr bool parallel(
const OtherOrientedSegment& other)
const;
917 template<LineConcept OtherLine>
918 [[nodiscard]]
constexpr bool parallel(
const OtherLine& other)
const;
928 template<OrientedLineConcept OtherOrientedLine>
929 [[nodiscard]]
constexpr bool parallel(
const OtherOrientedLine& other)
const;
939 template<RayConcept OtherRay>
940 [[nodiscard]]
constexpr bool parallel(
const OtherRay& other)
const;
943 template<Po
intConcept OtherPo
int>
944 [[nodiscard]]
constexpr bool intersects(
const OtherPoint& other)
const;
956 template<SegmentConcept OtherSegment>
957 [[nodiscard]]
constexpr bool intersects(
const OtherSegment& other)
const;
963 template<
typename OtherShape>
965 [[nodiscard]]
constexpr bool intersects(
const OtherShape& other)
const {
966 return other.intersects(*
this);
970 template <
class EmptyPo
int>
988 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
989 [[nodiscard]]
constexpr std::optional<Point<ResultNumber, typename PointType::LabelType>>
993 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
998 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1000 && (detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1001 &&
requires(
const OtherShape& o,
const Segment& self) {
1009 template <
class ResultNumber = NumberType,
class EmptyPo
int>
1026 template <
class ResultNumber = division_result_t<NumberType>,
class OtherNumber>
1027 [[nodiscard]]
constexpr std::optional<ResultNumber>
1042 template <
class ResultNumber = division_result_t<NumberType>,
class OtherNumber>
1043 [[nodiscard]]
constexpr std::optional<ResultNumber>
1049 template<Po
intConcept OtherPo
int>
1050 [[nodiscard]]
constexpr bool separates(
const OtherPoint& other)
const;
1064 template<SegmentConcept OtherSegment>
1065 [[nodiscard]]
constexpr bool separates(
const OtherSegment& other)
const;
1068 template<OrientedSegmentConcept OtherOrientedSegment>
1069 [[nodiscard]]
constexpr bool separates(
const OtherOrientedSegment& other)
const;
1072 template<LineConcept OtherLine>
1073 [[nodiscard]]
constexpr bool separates(
const OtherLine& other)
const;
1076 template<OrientedLineConcept OtherOrientedLine>
1077 [[nodiscard]]
constexpr bool separates(
const OtherOrientedLine& other)
const;
1080 template<RayConcept OtherRay>
1081 [[nodiscard]]
constexpr bool separates(
const OtherRay& other)
const;
1084 template<RectangleConcept OtherRectangle>
1085 [[nodiscard]]
constexpr bool separates(
const OtherRectangle& other)
const;
1088 template<TriangleConcept OtherTriangle>
1089 [[nodiscard]]
constexpr bool separates(
const OtherTriangle& other)
const;
1092 template<HalfplaneConcept OtherHalfplane>
1093 [[nodiscard]]
constexpr bool separates(
const OtherHalfplane& other)
const;
1096 template<ConvexConcept OtherConvex>
1097 [[nodiscard]]
constexpr bool separates(
const OtherConvex& other)
const;
1110 template<PolygonConcept OtherPolygon>
1111 [[nodiscard]]
constexpr bool separates(
const OtherPolygon& other)
const;
1114 template<MonotoneChainConcept OtherChain>
1115 [[nodiscard]]
constexpr bool contains(
const OtherChain& other)
const;
1118 template<MonotoneChainConcept OtherChain>
1120 return detail::reduceDegenerateToPoint(
1125 template<MonotoneChainConcept OtherChain>
1129 template<MonotoneChainConcept OtherChain>
1130 [[nodiscard]]
constexpr bool separates(
const OtherChain& other)
const;
1133 template<PolylineConcept OtherPolyline>
1134 [[nodiscard]]
constexpr bool contains(
const OtherPolyline& other)
const;
1137 template<PolylineConcept OtherPolyline>
1139 return detail::reduceDegenerateToPoint(
1144 template<PolylineConcept OtherPolyline>
1148 template<PolylineConcept OtherPolyline>
1149 [[nodiscard]]
constexpr bool separates(
const OtherPolyline& other)
const;
1152 template<HalfplaneIntersectionConcept OtherRegion>
1153 [[nodiscard]]
constexpr bool contains(
const OtherRegion& other)
const;
1156 template<HalfplaneIntersectionConcept OtherRegion>
1160 template<HalfplaneIntersectionConcept OtherRegion>
1164 template<HalfplaneIntersectionConcept OtherRegion>
1165 [[nodiscard]]
constexpr bool separates(
const OtherRegion& other)
const;
1174 template<PolygonWithHolesConcept OtherRegion>
1175 [[nodiscard]]
constexpr bool contains(
const OtherRegion& other)
const;
1183 template<PolygonWithHolesConcept OtherRegion>
1187 template<PolygonWithHolesConcept OtherRegion>
1197 template<PolygonWithHolesConcept OtherRegion>
1198 [[nodiscard]]
bool separates(
const OtherRegion& other)
const;
1209 template<PolygonSetConcept OtherSet>
1210 [[nodiscard]]
constexpr bool contains(
const OtherSet& other)
const {
1211 for (
const auto& component : other) {
1220 template<PolygonSetConcept OtherSet>
1222 for (
const auto& component : other) {
1231 template<PolygonSetConcept OtherSet>
1233 for (
const auto& component : other) {
1249 template<PolygonSetConcept OtherSet>
1253 template<DiskConcept OtherDisk>
1254 [[nodiscard]]
constexpr bool separates(
const OtherDisk& other)
const;
1269 template<Po
intConcept OtherPo
int>
1273 template<SegmentConcept OtherSegment>
1277 template<
typename OtherShape>
1280 return other.interiorsIntersect(*
this);
1284 template <
class EmptyPo
int>
1305 template<SegmentConcept OtherSegment>
1306 [[nodiscard]]
constexpr bool crosses(
const OtherSegment& other)
const;
1309 template<Po
intConcept OtherPo
int>
1310 [[nodiscard]]
constexpr bool crosses(
const OtherPoint& other)
const;
1313 template<
typename OtherShape>
1315 [[nodiscard]]
constexpr bool crosses(
const OtherShape& other)
const {
1316 return other.crosses(*
this);
1320 template <
class EmptyPo
int>
1346 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1364 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1373 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1374 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1375 &&
requires(
const OtherShape& o,
const Segment& self) {
1389 template <
class ResultNumber =
double,
class DiskPo
intType,
class DiskLabel>
1406 template <
class ResultNumber = NumberType, BoundedPolygonalConcept OtherShape>
1407 requires detail::ClosestPairConcept<Segment<TPoint, TLabel>, OtherShape>
1426 template <
class ResultNumber = division_result_t<NumberType>,
class OtherShape>
1427 requires detail::ClosestPointsPairConcept<Segment<TPoint, TLabel>, OtherShape>
1438 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1439 [[nodiscard]]
constexpr auto distanceL1(
const OtherPoint& point)
const;
1442 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1443 [[nodiscard]]
constexpr auto distanceL1(
const OtherSegment& other)
const;
1451 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1452 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1453 &&
requires(
const OtherShape& o,
const Segment& self) {
1456 [[nodiscard]]
constexpr auto distanceL1(
const OtherShape& other)
const {
1475 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1488 template <
class ResultNumber =
double, Po
intConcept OtherPo
int>
1501 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1505 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1506 [[nodiscard]]
constexpr auto distanceLInf(
const OtherSegment& other)
const;
1514 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1515 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1516 &&
requires(
const OtherShape& o,
const Segment& self) {
1531 template <
class ResultNumber =
double, Po
intConcept OtherPo
int>
1537 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1541 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1550 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1551 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1552 &&
requires(
const OtherShape& o,
const Segment& self) {
1567 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1573 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1577 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1586 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1587 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1588 &&
requires(
const OtherShape& o,
const Segment& self) {
1603 template <
class ResultNumber = division_result_t<NumberType>, Po
intConcept OtherPo
int>
1626 template <
class ResultNumber = division_result_t<NumberType>, SegmentConcept OtherSegment>
1637 template <
class ResultNumber = NumberType, Po
intConcept OtherPo
int>
1646 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1647 requires ((detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1648 &&
requires(
const OtherShape& o,
const Segment& self) {
1671 template <
class ResultNumber = division_result_t<NumberType>>
1683 template <
class ResultNumber = division_result_t<NumberType>>
1694 template <
class OtherShape>
1721 template <
class ResultNumber = gr
id_number_t<
typename TPo
int::NumberType>>
1722 requires(detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
1739 template <std::
floating_po
int ResultNumber =
double>
1747 [[nodiscard]]
constexpr std::array<PointType, 2>
vertices()
const;
1763 [[nodiscard]]
constexpr std::array<Segment, 1>
edges()
const;
1770 [[nodiscard]]
constexpr std::array<OrientedSegment<PointType>, 1>
orientedEdges()
const;
1795 template <
class OtherShape>
1821 template <
class OtherShape>
1847 template <
class OtherShape>
1862 template <
class ResultNumber = division_result_t<NumberType>,
typename OtherShape>
1864 && (detail::shapeRank<OtherShape> > detail::shapeRank<Segment>)
1865 &&
requires(
const OtherShape& o,
const Segment& self) {
1873 template<Po
intConcept OtherPo
int>
1877 template<Po
intConcept OtherPo
int>
1881 template <
class Scalar>
1883 constexpr Segment&
operator*=(
const Scalar& scalar);
1886 template <
class Scalar>
1888 constexpr Segment&
operator/=(
const Scalar& scalar);
1891 template <std::
floating_po
int ResultNumber,
class Value>
1892 static constexpr ResultNumber lowerCoordinateBound(
const Value& value);
1894 template <std::
floating_po
int ResultNumber,
class Value>
1895 static constexpr ResultNumber upperCoordinateBound(
const Value& value);
1897 template<SegmentConcept OtherSegment>
1898 constexpr bool boundingBoxesOverlap(
const OtherSegment& other)
const;
1901 template<SegmentConcept OtherSegment>
1902 constexpr int boundingBoxesCross(
const OtherSegment& other)
const;
1904 std::array<PointType,2> points_{};
1905 [[no_unique_address]]
mutable LabelType label_{};
1919template <
class Po
intType,
class LabelType,
class TranslationNumber,
class TranslationLabel>
1932template <
class Po
intType,
class LabelType,
class Scalar>
1946template <
class Scalar,
class Po
intType,
class LabelType>
1960template <
class Po
intType,
class LabelType,
class Scalar>
1973template <
class Po
intType,
class LabelType>
Bounded polygonal primitives, convex or not.
Definition forward.hpp:373
Shape pairs whose Minkowski sum Pangolin can represent.
Definition forward.hpp:476
Definition forward.hpp:306
Definition arrangement.hpp:67
HalfplaneIntersection() -> HalfplaneIntersection< Point<>, NoLabel >
Definition halfplaneintersection.hpp:2308
@ y
Definition intervaltree.hpp:24
@ x
Definition intervaltree.hpp:24
@ vertex
Definition bitmatrix.hpp:37
Line() -> Line< Point<>, NoLabel >
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
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
Segment() -> Segment< Point<>, NoLabel >
Exact low-level orientation and incircle predicates.
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
Open polygonal chain stored in traversal order; may self-intersect.
Definition polyline.hpp:69
Axis-aligned rectangle stored by minimum and maximum corners.
Definition rectangle.hpp:75
Unoriented closed segment between two endpoints plus optional segment label.
Definition segment.hpp:58
constexpr bool boundaryContains(const Shape< OtherPoint > &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1080
constexpr auto minkowskiErosion(const OtherShape &other) const
Returns the Minkowski erosion of this shape by another (A ⊖ B).
Definition minkowskierosion.hpp:627
constexpr const PointType & operator[](std::size_t index) const
Returns endpoint 0 or 1.
Definition segment.hpp:151
constexpr auto distanceLInf(const OtherPoint &point) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:207
auto minkowskiSum(const OtherShape &other) const
Returns the regularized Minkowski sum of the two shapes (A ⊕ B).
Definition segment.hpp:1868
constexpr auto distanceLInf(const OtherShape &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition segment.hpp:1519
constexpr bool boundaryContains(const OtherLine &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:532
constexpr bool contains(const OtherRegion &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2726
constexpr std::ptrdiff_t index(const PointType &point) const
Definition segment.hpp:176
constexpr bool verticesContain(const OtherPoint &point) const
Returns whether one endpoint equals the given point.
Definition predicates.hpp:149
constexpr bool separates(const OtherPolygon &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:493
constexpr bool contains(const OtherPolyline &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2362
constexpr auto distanceL1(const Shape< OtherPoint > &other) const
Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own dist...
Definition segment.hpp:1489
constexpr bool interiorContains(const OtherHalfplane &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:798
constexpr bool crosses(const OtherSegment &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:38
constexpr bool contains(const OtherChain &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:2004
constexpr bool collinear(const OtherLine &other) const
Returns whether a line lies on the same supporting line.
Definition predicates.hpp:194
constexpr bool separates(const OtherOrientedSegment &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:373
constexpr bool contains(const OtherTriangle &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:181
constexpr Rectangle< Point< ResultNumber > > fbox() const
Returns a bounding box of the segment with floating point coordinates.
Definition bounding.hpp:81
constexpr bool interiorsIntersect(const EmptyShape< EmptyPoint > &) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition segment.hpp:1285
constexpr bool boundaryContains(const OtherChain &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:1119
constexpr auto cend() const
Returns an iterator past the last endpoint.
Definition segment.hpp:235
constexpr Segment(PointType first, PointType second)
Creates a segment from two endpoints.
Definition segment.hpp:78
constexpr bool contains(const OtherPoint &point) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:119
constexpr bool collinear(const OtherOrientedSegment &other) const
Returns whether an oriented segment lies on the same supporting line.
Definition predicates.hpp:188
constexpr bool separates(const OtherRegion &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:4563
constexpr std::array< PointType, 2 > vertices() const
Returns the two endpoints in canonical order.
Definition bounding.hpp:93
constexpr Line< PointType > asLine() const
Returns the supporting line.
Definition segment.hpp:294
constexpr auto hausdorffDistanceLInf(const OtherShape &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition segment.hpp:1591
bool separates(const OtherRegion &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:5647
constexpr bool boundaryContains(const OtherRegion &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
constexpr bool crosses(const EmptyShape< EmptyPoint > &) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition segment.hpp:1321
constexpr bool intersects(const OtherPoint &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:48
constexpr bool separates(const OtherPolyline &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:3499
constexpr bool contains(const OtherHalfplane &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:158
constexpr auto minkowskiSum(const OtherShape &other) const
Returns the Minkowski sum of this shape and another (A ⊕ B).
Definition minkowski.hpp:794
constexpr bool separates(const OtherRectangle &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:401
constexpr auto squaredHausdorffDistance(const OtherPoint &point) const
Returns the squared Hausdorff distance to a point.
Definition distance.hpp:166
constexpr bool interiorContains(const OtherRegion &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:2045
constexpr bool boundaryContains(const OtherConvex &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:556
constexpr Segment(const Segment< OtherPointType, OtherLabelType > &other)
Converts a segment with a different point and/or label type.
Definition segment.hpp:128
constexpr bool isDegenerate() const
Returns whether both endpoints coincide.
Definition predicates.hpp:54
constexpr auto closestSegments(const OtherShape &other) const
Returns the pair of elements realizing the distance, nothing when the shapes meet.
Definition closest.hpp:314
constexpr Segment(PointType first, PointType second, A &&label)
Creates a segment from two endpoints and stores a label.
Definition segment.hpp:109
constexpr Segment scaledUpX(const OtherNumber scalar) const
Returns the segment with its x-coordinates multiplied by a factor.
constexpr auto minkowskiErosion(const OtherShape &other) const
Returns the Minkowski erosion of this shape by a bounded polygonal one (A ⊖ B).
constexpr bool boundaryContains(const OtherPolyline &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:1138
constexpr Segment(NumberType x1, NumberType y1, NumberType x2, NumberType y2, A &&label)
Same as the four-coordinate constructor, and stores a label.
Definition segment.hpp:117
constexpr bool boundaryContains(const OtherSegment &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:520
constexpr bool isUndefined() const
Returns whether the segment is degenerate without collapsing to a point or to a segment.
Definition predicates.hpp:72
constexpr bool contains(const OtherDisk &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:201
constexpr void rotate90(int k=1)
Rotates the segment by 90k degrees around the origin in place.
Definition transformations.hpp:235
constexpr bool intersects(const OtherSegment &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:54
constexpr auto lengthLInf() const
Returns the Chebyshev length.
Definition measures.hpp:60
constexpr bool boundaryContains(const OtherHalfplane &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:541
constexpr bool contains(const OtherRay &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:152
constexpr auto distanceLInf(const OtherSegment &other) const
Returns the Chebyshev (LInf) distance to the given shape.
Definition distancelinf.hpp:214
constexpr EmptyShape< EmptyPoint > intersection(const EmptyShape< EmptyPoint > &) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition segment.hpp:1010
constexpr Rectangle< PointType > bbox() const
Returns the bounding box of the segment.
Definition bounding.hpp:72
TLabel LabelType
Definition segment.hpp:61
constexpr bool parallel(const OtherOrientedSegment &other) const
Returns whether an oriented segment is parallel to this one.
Definition predicates.hpp:212
constexpr std::optional< Point< ResultNumber, typename PointType::LabelType > > intersection(const OtherPoint &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition intersection.hpp:100
constexpr auto closestPoints(const OtherShape &other) const
Returns the pair of points realizing the distance, nothing when the shapes meet.
Definition closest.hpp:321
constexpr bool boundaryContains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:731
constexpr bool pointInsideInteriorContainedIn(const OtherShape &shape) const
Tests whether some point in this shape's relative interior lies in the strict interior of shape.
Definition measures.hpp:94
constexpr bool collinear(const OtherRay &other) const
Returns whether a ray lies on the same supporting line.
Definition predicates.hpp:206
constexpr bool interiorsIntersect(const Shape< PointType > &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:116
constexpr bool separates(const OtherConvex &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:470
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 segment.hpp:1476
constexpr bool boundaryContains(const OtherRay &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:538
constexpr bool separates(const OtherSegment &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:321
constexpr bool interiorContains(const OtherRegion &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
constexpr Segment & operator-=(const OtherPoint &translation)
Translates the segment by the negation of the given point in place.
constexpr void scaleDownY(const OtherNumber scalar)
Divides the segment's y-coordinates by a divisor in place.
Definition transformations.hpp:291
constexpr bool crosses(const Shape< PointType > &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:89
constexpr std::optional< std::variant< Point< ResultNumber, typename PointType::LabelType >, Segment< Point< ResultNumber, typename PointType::LabelType > > > > intersection(const OtherSegment &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition intersection.hpp:110
constexpr bool separates(const OtherDisk &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:512
constexpr bool containsCollinear(const OtherPoint &point) const
Returns whether the segment contains the given point that is collinear with the segment.
Definition predicates.hpp:161
constexpr auto lengthL1() const
Returns the Manhattan length.
Definition measures.hpp:55
constexpr bool parallel(const OtherOrientedLine &other) const
Returns whether an oriented line is parallel to this segment.
Definition predicates.hpp:604
constexpr ResultNumber slope() const
Returns the slope of the segment.
Definition measures.hpp:66
constexpr bool boundaryContains(const OtherRectangle &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:544
constexpr auto end() const
Returns an iterator past the last endpoint.
Definition segment.hpp:226
constexpr Segment scaledDownY(const OtherNumber scalar) const
Returns the segment with its y-coordinates divided by a divisor.
constexpr bool contains(const OtherLine &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:140
constexpr bool contains(const OtherRectangle &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:164
constexpr bool isHorizontal() const
Returns whether the segment is horizontal.
Definition predicates.hpp:82
constexpr void scaleUpY(const OtherNumber scalar)
Multiplies the segment's y-coordinates by a factor in place.
Definition transformations.hpp:263
constexpr bool interiorContains(const OtherPoint &point) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:110
constexpr auto begin() const
Returns an iterator to the first endpoint.
Definition segment.hpp:208
constexpr Point< ResultNumber > midpoint() const
Returns the midpoint of the segment.
Definition measures.hpp:79
constexpr bool separates(const OtherChain &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:3149
constexpr auto hausdorffDistanceL1(const Shape< OtherPoint > &other) const
Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own haus...
Definition segment.hpp:1568
constexpr auto hausdorffDistanceL1(const OtherShape &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition segment.hpp:1555
constexpr auto distanceL1(const OtherShape &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition segment.hpp:1456
constexpr std::array< Segment, 1 > edges() const
Returns the unique boundary edge of the segment.
Definition bounding.hpp:98
detail::floating_result_t< ResultNumber > squaredDistance(const Disk< DiskPointType, DiskLabel > &disk) const
Returns the squared Euclidean distance to a disk.
Definition segment.hpp:1390
constexpr bool contains(const OtherPolygon &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:1706
constexpr auto operator<=>(const Segment &other) const
Provides lexicographic ordering on (x1,y1),(x2,y2).
Definition segment.hpp:261
constexpr bool separates(const OtherOrientedLine &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:385
constexpr Segment scaledUpY(const OtherNumber scalar) const
Returns the segment with its y-coordinates multiplied by a factor.
constexpr bool contains(const OtherOrientedLine &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:146
constexpr bool interiorContains(const OtherRay &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:795
constexpr const PointType & max() const
Returns the largest stored endpoint.
Definition segment.hpp:199
std::vector< Point< ResultNumber, typename PointType::LabelType > > latticePoints() const
Returns the integer points the segment contains.
Definition lattice.hpp:373
constexpr bool crosses(const OtherPoint &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition crosses.hpp:84
constexpr bool separates(const EmptyShape< EmptyPoint > &) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition segment.hpp:741
constexpr bool intersects(const OtherShape &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition segment.hpp:965
constexpr bool interiorContains(const OtherSegment &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:116
static constexpr std::size_t size()
Returns the number of endpoints (always 2).
Definition segment.hpp:159
constexpr bool contains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition segment.hpp:726
PointType PointType
Definition segment.hpp:59
constexpr bool interiorContains(const OtherSet &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:1232
ApproximateNumber length() const
Returns the Euclidean length.
Definition measures.hpp:50
constexpr const PointType & min() const
Returns the smallest stored endpoint.
Definition segment.hpp:190
constexpr bool isPoint() const
Returns whether the segment collapses to a single point.
Definition predicates.hpp:59
constexpr auto cbegin() const
Returns an iterator to the first endpoint.
Definition segment.hpp:217
constexpr bool containsEndpoint(const OtherPoint &point) const
Returns whether the given point is one endpoint.
Definition predicates.hpp:155
constexpr bool separates(const OtherLine &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:379
PointType::NumberType NumberType
Definition segment.hpp:60
constexpr auto squaredDistance(const OtherSegment &other) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:134
constexpr bool interiorContains(const OtherConvex &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:807
constexpr bool boundaryContains(const OtherSet &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:1221
constexpr HalfplaneIntersection< PointType > asHalfplaneIntersection() const
Returns the segment as a (degenerate) half-plane intersection.
Definition segment.hpp:307
constexpr ResultNumber area() const
Returns the area of the segment.
Definition measures.hpp:34
constexpr bool interiorsIntersect(const OtherShape &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition segment.hpp:1279
constexpr const PointType & get(std::ptrdiff_t index) const
Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the en...
Definition segment.hpp:167
bool separates(const OtherSet &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:5915
constexpr auto squaredDistance(const OtherPoint &point) const
Returns the squared Euclidean distance to the given shape.
Definition distance.hpp:100
constexpr bool intersects(const Shape< PointType > &other) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition intersects.hpp:118
constexpr bool collinear(const OtherPoint &point) const
Returns whether the given point lies on the supporting line.
Definition predicates.hpp:167
constexpr bool interiorsIntersect(const OtherPoint &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:39
constexpr bool contains(const OtherConvex &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:187
constexpr Segment rotated90(int k=1) const
Returns the segment rotated by 90k degrees around the origin.
Definition transformations.hpp:230
constexpr bool boundaryContains(const OtherPoint &point) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:110
constexpr bool separates(const OtherHalfplane &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:411
constexpr Segment & operator+=(const OtherPoint &translation)
Translates the segment by the given point in place.
constexpr bool interiorContains(const OtherOrientedSegment &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:122
constexpr bool interiorContains(const OtherPolygon &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:813
constexpr Polyline< PointType > asPolyline() const
Returns the segment as a two-vertex polyline.
Definition polyline.hpp:2595
constexpr bool collinear(const OtherOrientedLine &other) const
Returns whether an oriented line lies on the same supporting line.
Definition predicates.hpp:200
constexpr auto hausdorffDistanceL1(const OtherPoint &point) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition distancel1.hpp:969
constexpr auto hausdorffDistanceLInf(const OtherPoint &point) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition distancelinf.hpp:957
constexpr bool interiorContains(const OtherChain &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1459
constexpr auto hausdorffDistanceL1(const OtherSegment &other) const
Returns the Manhattan (L1) Hausdorff distance to the given shape.
Definition distancel1.hpp:961
constexpr bool contains(const OtherSet &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition segment.hpp:1210
constexpr bool boundaryContains(const OtherOrientedSegment &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:526
constexpr auto squaredDistance(const OtherShape &other) const
Returns the squared Euclidean distance to the given shape.
Definition segment.hpp:1378
constexpr bool boundaryContains(const OtherRegion &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition boundarycontains.hpp:1638
constexpr bool parallel(const OtherRay &other) const
Returns whether a ray is parallel to this segment.
Definition predicates.hpp:838
constexpr auto hausdorffDistanceLInf(const OtherSegment &other) const
Returns the Chebyshev (LInf) Hausdorff distance to the given shape.
Definition distancelinf.hpp:949
constexpr auto intersection(const OtherShape &other) const
Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
Definition segment.hpp:1004
constexpr bool collinear(const OtherSegment &other) const
Returns whether another segment lies on the same supporting line.
Definition predicates.hpp:176
constexpr bool intersects(const EmptyShape< EmptyPoint > &) const
Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
Definition segment.hpp:971
constexpr bool samePointSet(const OtherShape &other) const
Tests whether another shape defines exactly the same point set.
Definition samepointset.hpp:1947
constexpr bool interiorContains(const OtherDisk &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:819
constexpr void scaleUpX(const OtherNumber scalar)
Multiplies the segment's x-coordinates by a factor in place.
Definition transformations.hpp:249
constexpr bool separates(const Shape< PointType > &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:519
constexpr bool boundaryContains(const OtherDisk &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:568
constexpr auto hausdorffDistanceLInf(const Shape< OtherPoint > &other) const
Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own haus...
Definition segment.hpp:1604
constexpr Point< ResultNumber > pointInside() const
Returns a point inside the segment.
Definition measures.hpp:88
constexpr Segment scaledDownX(const OtherNumber scalar) const
Returns the segment with its x-coordinates divided by a divisor.
constexpr bool boundaryContains(const OtherOrientedLine &) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:535
constexpr auto distanceL1(const OtherPoint &point) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:219
constexpr bool crosses(const OtherShape &other) const
Tests whether the two shapes mutually separate each other (each disconnects the other).
Definition segment.hpp:1315
constexpr bool contains(const Shape< OtherPoint > &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:207
constexpr bool interiorContains(const Shape< OtherPoint > &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:134
constexpr bool interiorContains(const OtherLine &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:789
constexpr bool operator==(const Segment &other) const
Compares two segments by their endpoints; the label is ignored.
Definition segment.hpp:245
constexpr bool boundaryContains(const OtherPolygon &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:562
constexpr bool boundaryContains(const OtherTriangle &other) const
Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
Definition segment.hpp:550
constexpr bool isVertical() const
Returns whether the segment is vertical.
Definition predicates.hpp:77
constexpr bool contains(const OtherOrientedSegment &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:134
constexpr bool interiorsIntersect(const OtherSegment &other) const
Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
Definition interiorsintersect.hpp:46
constexpr NumberType twiceArea() const
Returns twice the area of the segment.
Definition measures.hpp:39
constexpr A & label() const
Definition segment.hpp:275
constexpr Segment diameter() const
Returns a segment defining the diameter.
Definition measures.hpp:73
constexpr bool contains(const OtherRegion &other) const
Tests whether this shape contains the other shape (A ⊇ B).
constexpr Segment(NumberType x1, NumberType y1, NumberType x2, NumberType y2)
Creates a segment from four coordinates.
Definition segment.hpp:94
constexpr auto squaredHausdorffDistance(const OtherSegment &other) const
Returns the squared Hausdorff distance to another segment.
Definition distance.hpp:152
constexpr auto squaredLength() const
Returns the squared Euclidean length.
Definition measures.hpp:44
constexpr bool separates(const OtherPoint &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:315
constexpr Segment()=default
Creates the degenerate segment (0,0)--(0,0).
constexpr auto distanceL1(const OtherSegment &other) const
Returns the Manhattan (L1) distance to the given shape.
Definition distancel1.hpp:226
constexpr bool contains(const OtherSegment &other) const
Tests whether this shape contains the other shape (A ⊇ B).
Definition contains.hpp:128
constexpr Convex< PointType > convexHull() const
Returns the convex hull of the segment's endpoints.
Definition segment.hpp:1754
constexpr bool interiorContains(const OtherTriangle &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:128
constexpr std::array< OrientedSegment< PointType >, 1 > orientedEdges() const
Returns the unique oriented boundary edge in canonical order.
Definition bounding.hpp:103
constexpr void scaleDownX(const OtherNumber scalar)
Divides the segment's x-coordinates by a divisor in place.
Definition transformations.hpp:277
constexpr bool interiorContains(const OtherOrientedLine &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:792
constexpr bool separates(const OtherTriangle &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:417
constexpr auto squaredHausdorffDistance(const OtherShape &other) const
Returns the squared Hausdorff distance to the given shape.
Definition segment.hpp:1651
constexpr bool parallel(const OtherLine &other) const
Returns whether a line is parallel to this segment.
Definition predicates.hpp:472
constexpr bool interiorContains(const OtherPolyline &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition interiorcontains.hpp:1682
constexpr std::optional< ResultNumber > yAtX(const OtherNumber &x) const
Returns the value of the y coordinate for a given x, if it exists.
Definition atxy.hpp:30
constexpr bool separates(const OtherRay &other) const
Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
Definition separates.hpp:391
constexpr auto distanceLInf(const Shape< OtherPoint > &other) const
Returns the distance to the given shape, using symmetry to re-dispatch through the wrapper's own dist...
Definition segment.hpp:1532
constexpr bool parallel(const OtherSegment &other) const
Returns whether another segment is parallel to this one.
Definition predicates.hpp:182
constexpr std::optional< ResultNumber > xAtY(const OtherNumber &y) const
Returns the value of the x coordinate for a given y, if it exists.
Definition atxy.hpp:61
constexpr std::optional< PointType > getIfPoint() const
Returns the point the segment collapses to, if it does.
Definition predicates.hpp:64
constexpr bool interiorContains(const EmptyShape< EmptyPoint > &) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:736
constexpr bool interiorContains(const OtherRectangle &other) const
Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
Definition segment.hpp:801
Runtime variant wrapper over the supported primitive shapes.
Definition shape.hpp:160