Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
pgl::Disk< PointType_, TLabel > Struct Template Reference

Closed Euclidean disk stored by boundary points plus optional disk label. More...

#include <disk.hpp>

Inheritance diagram for pgl::Disk< PointType_, TLabel >:
[legend]

Classes

class  PointIterator
 Forward iterator over the three boundary points. More...

Public Types

using PointType = PointType_
using NumberType = PointType::NumberType
using PointLabelType = PointType::LabelType
using LabelType = TLabel

Public Member Functions

constexpr Disk ()=default
 Creates a disk with all three boundary points at the origin.
constexpr Disk (PointType first, PointType second, PointType third)
 Creates the disk through three boundary points.
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>) && PointConcept<PointType>
constexpr Disk (PointType first, PointType second, PointType third, A &&label)
 Creates a disk from three boundary points and stores a label.
constexpr Disk (PointType center, NumberType radius)
 Creates a disk from its center and radius.
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>) && PointConcept<PointType>
constexpr Disk (PointType center, NumberType radius, A &&label)
 Same as above, and stores a disk label.
constexpr Disk (NumberType x, NumberType y, NumberType radius)
 Creates a disk from center coordinates and a radius.
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
constexpr Disk (NumberType x, NumberType y, NumberType radius, A &&label)
 Same as above, and stores a disk label.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr Disk (const Disk< OtherPointType, OtherLabelType > &other)
 Converts a disk with a different point and/or label type.
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
constexpr Diskoperator= (const Disk< OtherPointType, OtherLabelType > &other)
 Assigns from a disk with compatible point and label types.
template<class A = LabelType>
requires (detail::has_label_v<A>)
constexpr A & label () const
 Returns the disk label.
constexpr const PointTypeoperator[] (std::size_t index) const
 Returns boundary point index in canonical order.
constexpr const PointTypeget (std::ptrdiff_t index) const
 Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end.
constexpr std::ptrdiff_t index (const PointType &point) const
 Returns the smallest index i with (*this)[i] == point, or -1 if no boundary point equals point.
constexpr const PointTypea () const
 Returns the first boundary point (lexicographically smallest).
constexpr const PointTypeb () const
 Returns the second boundary point in canonical order.
constexpr const PointTypec () const
 Returns the third boundary point in canonical order.
constexpr auto begin () const
 Returns an iterator to the first boundary point.
constexpr auto cbegin () const
 Returns a const iterator to the first boundary point.
constexpr auto end () const
 Returns an iterator past the last boundary point.
constexpr auto cend () const
 Returns a const iterator past the last boundary point.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber, PointLabelTypecenter () const
 Returns the center (circumcenter of the three boundary points) in an explicitly chosen coordinate type.
template<class ResultNumber = double>
constexpr ResultNumber radius () const
 Returns the radius.
constexpr bool isDegenerate () const
 Returns whether the three boundary points are collinear.
constexpr bool isPoint () const
 Returns whether the disk collapses to a single point.
constexpr std::optional< PointTypegetIfPoint () const
 Returns the point the disk collapses to, if it does.
constexpr bool isUndefined () const
 Returns whether the disk is degenerate without collapsing to a point.
template<class ResultNumber = division_result_t<NumberType>>
constexpr ResultNumber squaredRadius () const
 Returns the squared radius in an explicitly chosen result type.
template<std::floating_point ResultNumber = double>
constexpr ResultNumber area () const
 Returns the area pi * R^2 of the closed disk.
constexpr Rectangle< PointTypebbox () const
 Returns an axis-aligned bounding box in the coordinate type.
template<class ResultNumber = grid_number_t<typename PointType_::NumberType>>
requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
std::vector< Point< ResultNumber, typename PointType::LabelType > > latticePoints () const
 Returns the integer points the disk contains.
template<std::floating_point ResultNumber = double>
constexpr Rectangle< Point< ResultNumber > > fbox () const
 Returns a floating-point bounding box of the disk.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Point< ResultNumber, PointLabelTypepointInside () const
 Returns the midpoint of the first two boundary points.
template<class ResultNumber = division_result_t<NumberType>>
constexpr Segment< Point< ResultNumber, PointLabelType > > diameter () const
 Returns a segment defining a diameter of the disk.
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherPoint &point) const
 Returns the squared Euclidean distance from this disk to a point.
template<class ResultNumber = double, SegmentConcept OtherSegment>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherSegment &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, OrientedSegmentConcept OtherOrientedSegment>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherOrientedSegment &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, LineConcept OtherLine>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherLine &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, OrientedLineConcept OtherOrientedLine>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherOrientedLine &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, RayConcept OtherRay>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherRay &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, HalfplaneConcept OtherHalfplane>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherHalfplane &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, RectangleConcept OtherRectangle>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherRectangle &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, TriangleConcept OtherTriangle>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherTriangle &other) const
 Returns the squared Euclidean distance from this disk to a shape.
template<class ResultNumber = double, DiskConcept OtherDisk>
detail::floating_result_t< ResultNumber > squaredDistance (const OtherDisk &other) const
 Returns the squared Euclidean distance between two disks.
template<class ResultNumber = double, typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk> && requires(const OtherShape& o,
const Disk& self) { o.squaredDistance(self); })
detail::floating_result_t< ResultNumber > squaredDistance (const OtherShape &other) const
 Returns the squared Euclidean distance to the given shape.
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > distanceL1 (const OtherPoint &point) const
 Returns the Manhattan (L1) distance from this disk to a point.
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > distanceLInf (const OtherPoint &point) const
 Returns the Chebyshev (LInf) distance from this disk to a point.
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
constexpr auto intersection (const Shape< OtherPoint > &other) const
 Returns the intersection of the two shapes (A ∩ B), re-dispatching through the wrapper's own intersection.
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > distanceL1 (const Shape< OtherPoint > &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > distanceLInf (const Shape< OtherPoint > &other) const
 Returns the Manhattan (L1) distance to the given shape.
template<PointConcept OtherPoint>
constexpr bool contains (const OtherPoint &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<class ResultNumber = NumberType, PointConcept OtherPoint>
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.
template<class ResultNumber = NumberType, class EmptyPoint>
constexpr EmptyShape< EmptyPoint > intersection (const EmptyShape< EmptyPoint > &) const
 Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.
template<SegmentConcept OtherSegment>
constexpr bool contains (const OtherSegment &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool contains (const OtherOrientedSegment &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<LineConcept OtherLine>
constexpr bool contains (const OtherLine &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool contains (const OtherOrientedLine &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<RayConcept OtherRay>
constexpr bool contains (const OtherRay &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneConcept OtherHalfplane>
constexpr bool contains (const OtherHalfplane &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool contains (const OtherTriangle &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<RectangleConcept OtherRectangle>
constexpr bool contains (const OtherRectangle &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool contains (const OtherConvex &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool contains (const OtherPolygon &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool contains (const OtherDisk &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
constexpr bool contains (const Shape< PointType > &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<class EmptyPoint>
constexpr bool contains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<class EmptyPoint>
constexpr bool boundaryContains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<class EmptyPoint>
constexpr bool interiorContains (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PointConcept OtherPoint>
constexpr bool interiorContains (const OtherPoint &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool interiorContains (const OtherSegment &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool interiorContains (const OtherOrientedSegment &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<LineConcept OtherLine>
constexpr bool interiorContains (const OtherLine &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool interiorContains (const OtherOrientedLine &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<RayConcept OtherRay>
constexpr bool interiorContains (const OtherRay &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<HalfplaneConcept OtherHalfplane>
constexpr bool interiorContains (const OtherHalfplane &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool interiorContains (const OtherTriangle &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<RectangleConcept OtherRectangle>
constexpr bool interiorContains (const OtherRectangle &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool interiorContains (const OtherConvex &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool interiorContains (const OtherDisk &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool intersects (const OtherSegment &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<DiskConcept OtherDisk>
constexpr bool intersects (const OtherDisk &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool boundaryContains (const OtherPoint &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<SegmentConcept OtherSegment>
constexpr bool boundaryContains (const OtherSegment &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool boundaryContains (const OtherOrientedSegment &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<LineConcept OtherLine>
constexpr bool boundaryContains (const OtherLine &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool boundaryContains (const OtherOrientedLine &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<RayConcept OtherRay>
constexpr bool boundaryContains (const OtherRay &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<HalfplaneConcept OtherHalfplane>
constexpr bool boundaryContains (const OtherHalfplane &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<TriangleConcept OtherTriangle>
constexpr bool boundaryContains (const OtherTriangle &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<RectangleConcept OtherRectangle>
constexpr bool boundaryContains (const OtherRectangle &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<ConvexConcept OtherConvex>
constexpr bool boundaryContains (const OtherConvex &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool boundaryContains (const OtherPolygon &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<DiskConcept OtherDisk>
constexpr bool boundaryContains (const OtherDisk &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
constexpr bool boundaryContains (const Shape< PointType > &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool interiorContains (const OtherPolygon &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonConcept OtherPolygon>
constexpr bool separates (const OtherPolygon &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<MonotoneChainConcept OtherChain>
constexpr bool contains (const OtherChain &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool boundaryContains (const OtherChain &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool interiorContains (const OtherChain &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<MonotoneChainConcept OtherChain>
constexpr bool separates (const OtherChain &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolylineConcept OtherPolyline>
constexpr bool contains (const OtherPolyline &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool boundaryContains (const OtherPolyline &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool interiorContains (const OtherPolyline &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolylineConcept OtherPolyline>
constexpr bool separates (const OtherPolyline &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool contains (const OtherRegion &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool boundaryContains (const OtherRegion &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool interiorContains (const OtherRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<HalfplaneIntersectionConcept OtherRegion>
constexpr bool separates (const OtherRegion &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool contains (const OtherRegion &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool boundaryContains (const OtherRegion &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
constexpr bool interiorContains (const OtherRegion &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonWithHolesConcept OtherRegion>
bool separates (const OtherRegion &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PolygonSetConcept OtherSet>
constexpr bool contains (const OtherSet &other) const
 Tests whether this shape contains the other shape (A ⊇ B).
template<PolygonSetConcept OtherSet>
constexpr bool boundaryContains (const OtherSet &other) const
 Tests whether this shape's boundary contains the other shape (∂A ⊇ B).
template<PolygonSetConcept OtherSet>
constexpr bool interiorContains (const OtherSet &other) const
 Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).
template<PolygonSetConcept OtherSet>
bool separates (const OtherSet &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PointConcept OtherPoint>
constexpr bool separates (const OtherPoint &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<SegmentConcept OtherSegment>
constexpr bool separates (const OtherSegment &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool separates (const OtherOrientedSegment &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<LineConcept OtherLine>
constexpr bool separates (const OtherLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool separates (const OtherOrientedLine &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<ConvexConcept OtherConvex>
constexpr bool separates (const OtherConvex &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<RayConcept OtherRay>
constexpr bool separates (const OtherRay &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<HalfplaneConcept OtherHalfplane>
constexpr bool separates (const OtherHalfplane &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<RectangleConcept OtherRectangle>
constexpr bool separates (const OtherRectangle &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<TriangleConcept OtherTriangle>
constexpr bool separates (const OtherTriangle &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<DiskConcept OtherDisk>
constexpr bool separates (const OtherDisk &other) const
 Tests whether removing this shape disconnects the other shape (B∖A is disconnected).
template<PointConcept OtherPoint>
constexpr bool intersects (const OtherPoint &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool intersects (const OtherOrientedSegment &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<LineConcept OtherLine>
constexpr bool intersects (const OtherLine &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool intersects (const OtherOrientedLine &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<RayConcept OtherRay>
constexpr bool intersects (const OtherRay &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<HalfplaneConcept OtherHalfplane>
constexpr bool intersects (const OtherHalfplane &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<RectangleConcept OtherRectangle>
constexpr bool intersects (const OtherRectangle &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<TriangleConcept OtherTriangle>
constexpr bool intersects (const OtherTriangle &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool interiorsIntersect (const OtherPoint &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<SegmentConcept OtherSegment>
constexpr bool interiorsIntersect (const OtherSegment &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool interiorsIntersect (const OtherOrientedSegment &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<LineConcept OtherLine>
constexpr bool interiorsIntersect (const OtherLine &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool interiorsIntersect (const OtherOrientedLine &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<RayConcept OtherRay>
constexpr bool interiorsIntersect (const OtherRay &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<HalfplaneConcept OtherHalfplane>
constexpr bool interiorsIntersect (const OtherHalfplane &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<RectangleConcept OtherRectangle>
constexpr bool interiorsIntersect (const OtherRectangle &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<TriangleConcept OtherTriangle>
constexpr bool interiorsIntersect (const OtherTriangle &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<DiskConcept OtherDisk>
constexpr bool interiorsIntersect (const OtherDisk &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool crosses (const OtherPoint &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<SegmentConcept OtherSegment>
constexpr bool crosses (const OtherSegment &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<OrientedSegmentConcept OtherOrientedSegment>
constexpr bool crosses (const OtherOrientedSegment &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<LineConcept OtherLine>
constexpr bool crosses (const OtherLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<OrientedLineConcept OtherOrientedLine>
constexpr bool crosses (const OtherOrientedLine &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<RayConcept OtherRay>
constexpr bool crosses (const OtherRay &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<HalfplaneConcept OtherHalfplane>
constexpr bool crosses (const OtherHalfplane &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<RectangleConcept OtherRectangle>
constexpr bool crosses (const OtherRectangle &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<TriangleConcept OtherTriangle>
constexpr bool crosses (const OtherTriangle &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<DiskConcept OtherDisk>
constexpr bool crosses (const OtherDisk &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<PointConcept OtherPoint>
constexpr bool intersects (const Shape< OtherPoint > &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool interiorsIntersect (const Shape< OtherPoint > &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<PointConcept OtherPoint>
constexpr bool crosses (const Shape< OtherPoint > &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk>)
constexpr bool intersects (const OtherShape &other) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<class EmptyPoint>
constexpr bool intersects (const EmptyShape< EmptyPoint > &) const
 Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk>)
constexpr bool interiorsIntersect (const OtherShape &other) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<class EmptyPoint>
constexpr bool interiorsIntersect (const EmptyShape< EmptyPoint > &) const
 Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk>)
constexpr bool crosses (const OtherShape &other) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<class EmptyPoint>
constexpr bool crosses (const EmptyShape< EmptyPoint > &) const
 Tests whether the two shapes mutually separate each other (each disconnects the other).
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr Diskoperator/= (const Scalar &scalar)
 Divides every boundary point by scalar in place.
constexpr bool operator== (const Disk &other) const
 Returns whether two disks describe the same closed region.
template<AnyShapeConcept OtherShape>
constexpr bool samePointSet (const OtherShape &other) const
 Tests whether another shape defines exactly the same point set.
constexpr std::partial_ordering operator<=> (const Disk &other) const
 Orders disks by increasing squared radius, then by center.
constexpr Disk rotated90 (int k=1) const
 Returns the disk rotated by 90k degrees around the origin.
constexpr void rotate90 (int k=1)
 Rotates the disk by 90k degrees around the origin in place.
template<class OtherShape>
requires MinkowskiSummableConcept<Disk<PointType_, TLabel>, OtherShape>
constexpr auto minkowskiSum (const OtherShape &other) const
 Returns the Minkowski sum of this shape and another (A ⊕ B).
template<class OtherShape>
requires MinkowskiSummableConcept<Disk<PointType_, TLabel>, OtherShape>
constexpr auto minkowskiErosion (const OtherShape &other) const
 Returns the Minkowski erosion of this shape by another (A ⊖ B).
template<class ResultNumber = double, DiskConcept OtherDisk>
std::optional< Disk< Point< ResultNumber, PointLabelType > > > minkowskiErosion (const OtherDisk &other) const
 Returns the Minkowski erosion of this disk by another (A ⊖ B), a disk when there is one.
template<class ResultNumber = double, HalfplaneConcept OtherHalfplane>
EmptyShape< Point< ResultNumber, PointLabelType > > minkowskiErosion (const OtherHalfplane &other) const
 Returns the Minkowski erosion of this disk by a half-plane (A ⊖ B), which is empty.
template<class ResultNumber = double, DiskConcept OtherDisk>
Disk< Point< ResultNumber, PointLabelType > > minkowskiSum (const OtherDisk &other) const
 Returns the Minkowski sum of the two disks (A ⊕ B), a disk.
template<class ResultNumber = double, HalfplaneConcept OtherHalfplane>
Halfplane< Point< ResultNumber, PointLabelType > > minkowskiSum (const OtherHalfplane &other) const
 Returns the Minkowski sum of this disk and a half-plane (A ⊕ B), a half-plane.
template<PointConcept OtherPoint>
constexpr Diskoperator+= (const OtherPoint &translation)
 Translates the disk by translation in place.
template<PointConcept OtherPoint>
constexpr Diskoperator-= (const OtherPoint &translation)
 Translates the disk by -translation in place.
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
constexpr Diskoperator*= (const Scalar &scalar)
 Scales every boundary point by scalar in place.
template<class OtherShape>
constexpr bool pointInsideInteriorContainedIn (const OtherShape &shape) const
 Tests whether some point strictly inside this disk lies in the strict interior of shape.
template<class ResultNumber, DiskConcept OtherDisk>
Disk< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > minkowskiSum (const OtherDisk &other) const
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
Halfplane< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > minkowskiSum (const OtherHalfplane &other) const
template<class ResultNumber, DiskConcept OtherDisk>
std::optional< Disk< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > > minkowskiErosion (const OtherDisk &other) const
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
EmptyShape< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > minkowskiErosion (const OtherHalfplane &other) const

Static Public Member Functions

static constexpr std::size_t size ()
 Returns the number of stored boundary points (always 3).

Detailed Description

template<class PointType_, class TLabel>
struct pgl::Disk< PointType_, TLabel >

Closed Euclidean disk stored by boundary points plus optional disk label.

Closed disk represented by three canonicalized boundary points.

The three stored points are kept in a canonical form so that two disks describing the same circle compare equal regardless of how they were built: the points are sorted lexicographically and, when not collinear, reordered to counterclockwise winding (see canonicalizePoints). The center/radius constructors are conveniences; the stored representation is always three boundary points, matching Triangle.

Template Parameters
PointType_Boundary point type; must be a pgl::Point.
TLabelOptional label type carried with the disk (NoLabel to omit).

Member Typedef Documentation

◆ LabelType

template<class PointType_, class TLabel>
using pgl::Disk< PointType_, TLabel >::LabelType = TLabel

◆ NumberType

template<class PointType_, class TLabel>
using pgl::Disk< PointType_, TLabel >::NumberType = PointType::NumberType

◆ PointLabelType

template<class PointType_, class TLabel>
using pgl::Disk< PointType_, TLabel >::PointLabelType = PointType::LabelType

◆ PointType

template<class PointType_, class TLabel>
using pgl::Disk< PointType_, TLabel >::PointType = PointType_

Constructor & Destructor Documentation

◆ Disk() [1/8]

template<class PointType_, class TLabel>
pgl::Disk< PointType_, TLabel >::Disk ( )
constexprdefault

Creates a disk with all three boundary points at the origin.

◆ Disk() [2/8]

template<class PointType_, class TLabel>
pgl::Disk< PointType_, TLabel >::Disk ( PointType first,
PointType second,
PointType third )
inlineconstexpr

Creates the disk through three boundary points.

The points are stored in canonical order, so argument order does not matter.

◆ Disk() [3/8]

template<class PointType_, class TLabel>
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>) && PointConcept<PointType>
pgl::Disk< PointType_, TLabel >::Disk ( PointType first,
PointType second,
PointType third,
A && label )
inlineconstexpr

Creates a disk from three boundary points and stores a label.

Template Parameters
AType convertible to LabelType.
Parameters
first,second,thirdBoundary points (canonicalized on storage).
labelDisk label, forwarded into the stored label.

◆ Disk() [4/8]

template<class PointType_, class TLabel>
pgl::Disk< PointType_, TLabel >::Disk ( PointType center,
NumberType radius )
inlineconstexpr

Creates a disk from its center and radius.

The leftmost, rightmost and topmost points of the circle are stored as the three boundary points, which is exact for any number type (no division). A negative radius is treated as its absolute value. The center's point label, if any, is copied onto the three boundary points.

◆ Disk() [5/8]

template<class PointType_, class TLabel>
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>) && PointConcept<PointType>
pgl::Disk< PointType_, TLabel >::Disk ( PointType center,
NumberType radius,
A && label )
inlineconstexpr

Same as above, and stores a disk label.

◆ Disk() [6/8]

template<class PointType_, class TLabel>
pgl::Disk< PointType_, TLabel >::Disk ( NumberType x,
NumberType y,
NumberType radius )
inlineconstexpr

Creates a disk from center coordinates and a radius.

◆ Disk() [7/8]

template<class PointType_, class TLabel>
template<class A>
requires (detail::has_label_v<LabelType> && std::constructible_from<LabelType, A&&>)
pgl::Disk< PointType_, TLabel >::Disk ( NumberType x,
NumberType y,
NumberType radius,
A && label )
inlineconstexpr

Same as above, and stores a disk label.

◆ Disk() [8/8]

template<class PointType_, class TLabel>
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
pgl::Disk< PointType_, TLabel >::Disk ( const Disk< OtherPointType, OtherLabelType > & other)
inlineconstexpr

Converts a disk with a different point and/or label type.

Each boundary point is converted to PointType and re-canonicalized (the canonical order may differ across coordinate types), and the label is copied when both sides carry one.

Member Function Documentation

◆ a()

template<class PointType_, class TLabel>
const PointType & pgl::Disk< PointType_, TLabel >::a ( ) const
inlineconstexpr

Returns the first boundary point (lexicographically smallest).

◆ area()

template<class PointType_, class TLabel>
template<std::floating_point ResultNumber = double>
ResultNumber pgl::Disk< PointType_, TLabel >::area ( ) const
inlinenodiscardconstexpr

Returns the area pi * R^2 of the closed disk.

Template Parameters
ResultNumberFloating-point result type.
Warning
Computes squaredRadius, which uses division unless the disk has been defined by center and radius.

◆ b()

template<class PointType_, class TLabel>
const PointType & pgl::Disk< PointType_, TLabel >::b ( ) const
inlineconstexpr

Returns the second boundary point in canonical order.

◆ bbox()

template<class PointType_, class TLabel>
Rectangle< PointType > pgl::Disk< PointType_, TLabel >::bbox ( ) const
inlinenodiscardconstexpr

Returns an axis-aligned bounding box in the coordinate type.

The box is guaranteed to contain the disk. When the disk was built from a center and radius the box is tight; otherwise the box may be larger than the disk.

Warning
The box may be larger than the disk if it is not contructed by center and radius.

◆ begin()

template<class PointType_, class TLabel>
auto pgl::Disk< PointType_, TLabel >::begin ( ) const
inlineconstexpr

Returns an iterator to the first boundary point.

◆ boundaryContains() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Disk< PointType_, TLabel >::boundaryContains ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [6/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [7/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [8/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [9/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

Unlike contains, this is the one-dimensional circle, not the filled region.

Template Parameters
OtherPointPoint type to test.
Returns
true if other lies on the circle (exact in-circle test).

◆ boundaryContains() [10/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [11/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [12/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [13/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [14/19]

template<class PointType_, class TLabel>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType_, TLabel >::boundaryContains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

A boundary has no area, so it holds only a region with no area — which is exactly the union of that region's ring edges.

◆ boundaryContains() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [17/19]

template<class PointType_, class TLabel>
template<PolygonSetConcept OtherSet>
bool pgl::Disk< PointType_, TLabel >::boundaryContains ( const OtherSet & other) const
inlinenodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ boundaryContains() [19/19]

template<class PointType, class LabelType>
bool pgl::Disk< PointType, LabelType >::boundaryContains ( const Shape< PointType > & other) const
nodiscardconstexpr

Tests whether this shape's boundary contains the other shape (∂A ⊇ B).

◆ c()

template<class PointType_, class TLabel>
const PointType & pgl::Disk< PointType_, TLabel >::c ( ) const
inlineconstexpr

Returns the third boundary point in canonical order.

a(), b(), c() wind counterclockwise.

◆ cbegin()

template<class PointType_, class TLabel>
auto pgl::Disk< PointType_, TLabel >::cbegin ( ) const
inlineconstexpr

Returns a const iterator to the first boundary point.

◆ cend()

template<class PointType_, class TLabel>
auto pgl::Disk< PointType_, TLabel >::cend ( ) const
inlineconstexpr

Returns a const iterator past the last boundary point.

◆ center()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
Point< ResultNumber, PointLabelType > pgl::Disk< PointType_, TLabel >::center ( ) const
inlinenodiscardconstexpr

Returns the center (circumcenter of the three boundary points) in an explicitly chosen coordinate type.

Template Parameters
ResultNumberCoordinate type of the result.
Warning
Computes the center via division by twice the signed area unless the disk has been created by center and radius.

◆ contains() [1/19]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Disk< PointType_, TLabel >::contains ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [2/19]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [3/19]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [4/19]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [5/19]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [6/19]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [7/19]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [8/19]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [9/19]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

Containment is boundary-inclusive: a point exactly on the circle counts as contained. Because the disk is convex, the shape overloads below reduce to this test on a finite set of points.

Template Parameters
OtherPointPoint type to test.
Returns
true if other is inside or on the boundary.

◆ contains() [10/19]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [11/19]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [12/19]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [13/19]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [14/19]

template<class PointType_, class TLabel>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType_, TLabel >::contains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

A region is contained exactly when its outer polygon is: the region holds the whole outer ring whatever its holes do, and this shape has a connected complement. See implementation/contains.hpp.

◆ contains() [15/19]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [16/19]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [17/19]

template<class PointType_, class TLabel>
template<PolygonSetConcept OtherSet>
bool pgl::Disk< PointType_, TLabel >::contains ( const OtherSet & other) const
inlinenodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [18/19]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::contains ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ contains() [19/19]

template<class PointType, class LabelType>
bool pgl::Disk< PointType, LabelType >::contains ( const Shape< PointType > & other) const
nodiscardconstexpr

Tests whether this shape contains the other shape (A ⊇ B).

◆ crosses() [1/13]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Disk< PointType_, TLabel >::crosses ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [2/13]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [3/13]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [4/13]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherLine & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [5/13]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [6/13]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [7/13]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [8/13]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherRay & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [9/13]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [10/13]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [11/13]

template<class PointType_, class TLabel>
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk>)
bool pgl::Disk< PointType_, TLabel >::crosses ( const OtherShape & other) const
inlinenodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [12/13]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::crosses ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ crosses() [13/13]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::crosses ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether the two shapes mutually separate each other (each disconnects the other).

◆ diameter()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
Segment< Point< ResultNumber, PointLabelType > > pgl::Disk< PointType_, TLabel >::diameter ( ) const
inlinenodiscardconstexpr

Returns a segment defining a diameter of the disk.

For a genuine 3-point disk the segment uses a() and its reflection across the exact center, so integral boundary points can still yield exact rational endpoints without introducing a square root.

Template Parameters
ResultNumberCoordinate type of the returned endpoints.
Warning
Uses division unless the disk is defined by center and radius.

◆ distanceL1() [1/2]

template<class PointType_, class TLabel>
template<class ResultNumber, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::distanceL1 ( const OtherPoint & point) const
nodiscard

Returns the Manhattan (L1) distance from this disk to a point.

Zero when the disk contains the point. Otherwise the nearest point of the disk lies on the circle, and its L1 distance to an external point is a trigonometric optimization with no closed form (unlike the Euclidean case's |point - center| - radius), so this refines a coarse angular scan with a golden-section search. The result defaults to double; an explicitly requested floating-point type is preserved.

◆ distanceL1() [2/2]

template<class PointType_, class TLabel>
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::distanceL1 ( const Shape< OtherPoint > & other) const
inlinenodiscard

Returns the Manhattan (L1) distance to the given shape.

Distance is symmetric, so this just calls other's own distanceL1 in the requested floating result type, which visits its wrapped alternative and throws if the pair is unsupported. Deducing OtherPoint from an actual Shape prevents a plain concrete shape from reaching this overload through an implicit conversion and recursively re-entering rank-based forwarding.

◆ distanceLInf() [1/2]

template<class PointType_, class TLabel>
template<class ResultNumber, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::distanceLInf ( const OtherPoint & point) const
nodiscard

Returns the Chebyshev (LInf) distance from this disk to a point.

Zero when the disk contains the point. Otherwise the nearest point of the disk lies on the circle, and its L1 distance to an external point is a trigonometric optimization with no closed form (unlike the Euclidean case's |point - center| - radius), so this refines a coarse angular scan with a golden-section search. The result defaults to double; an explicitly requested floating-point type is preserved.

◆ distanceLInf() [2/2]

template<class PointType_, class TLabel>
template<class ResultNumber = double, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::distanceLInf ( const Shape< OtherPoint > & other) const
inlinenodiscard

Returns the Manhattan (L1) distance to the given shape.

Distance is symmetric, so this just calls other's own distanceL1 in the requested floating result type, which visits its wrapped alternative and throws if the pair is unsupported. Deducing OtherPoint from an actual Shape prevents a plain concrete shape from reaching this overload through an implicit conversion and recursively re-entering rank-based forwarding.

◆ end()

template<class PointType_, class TLabel>
auto pgl::Disk< PointType_, TLabel >::end ( ) const
inlineconstexpr

Returns an iterator past the last boundary point.

◆ fbox()

template<class PointType_, class TLabel>
template<std::floating_point ResultNumber = double>
Rectangle< Point< ResultNumber > > pgl::Disk< PointType_, TLabel >::fbox ( ) const
inlinenodiscardconstexpr

Returns a floating-point bounding box of the disk.

The box spans [cx - r, cy - r] to [cx + r, cy + r]; it is tight up to floating-point rounding of the center and radius.

Template Parameters
ResultNumberFloating-point coordinate type of the box.
Warning
Computes center and radius, which use division.

◆ get()

template<class PointType_, class TLabel>
const PointType & pgl::Disk< PointType_, TLabel >::get ( std::ptrdiff_t index) const
inlineconstexpr

Cyclic access: same as operator[] but index is taken modulo size(); negative indices wrap from the end.

◆ getIfPoint()

template<class PointType_, class TLabel>
std::optional< PointType > pgl::Disk< PointType_, TLabel >::getIfPoint ( ) const
inlinenodiscardconstexpr

Returns the point the disk collapses to, if it does.

Complexity: O(1).

Returns
The common boundary point if isPoint, std::nullopt otherwise.

◆ index()

template<class PointType_, class TLabel>
std::ptrdiff_t pgl::Disk< PointType_, TLabel >::index ( const PointType & point) const
inlineconstexpr

Returns the smallest index i with (*this)[i] == point, or -1 if no boundary point equals point.

◆ interiorContains() [1/18]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Disk< PointType_, TLabel >::interiorContains ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [2/18]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherChain & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [3/18]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [4/18]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [5/18]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [6/18]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [7/18]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [8/18]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [9/18]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

Strict version of contains: a point exactly on the boundary circle is not interior-contained. Because the open disk is convex, the shape overloads below reduce to this test on a finite set of vertices.

◆ interiorContains() [10/18]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [11/18]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [12/18]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [13/18]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [14/18]

template<class PointType_, class TLabel>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType_, TLabel >::interiorContains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [15/18]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [16/18]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [17/18]

template<class PointType_, class TLabel>
template<PolygonSetConcept OtherSet>
bool pgl::Disk< PointType_, TLabel >::interiorContains ( const OtherSet & other) const
inlinenodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorContains() [18/18]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::interiorContains ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape's interior contains the other shape (A∖∂A ⊇ B).

◆ interiorsIntersect() [1/13]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Disk< PointType_, TLabel >::interiorsIntersect ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [2/13]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [3/13]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [4/13]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherLine & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [5/13]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [6/13]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [7/13]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [8/13]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherRay & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [9/13]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [10/13]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [11/13]

template<class PointType_, class TLabel>
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk>)
bool pgl::Disk< PointType_, TLabel >::interiorsIntersect ( const OtherShape & other) const
inlinenodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [12/13]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ interiorsIntersect() [13/13]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::interiorsIntersect ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether the interiors of the two shapes intersect ((A∖∂A) ∩ (B∖∂B) ≠ ∅).

◆ intersection() [1/3]

template<class PointType_, class TLabel>
template<class ResultNumber = NumberType, class EmptyPoint>
EmptyShape< EmptyPoint > pgl::Disk< PointType_, TLabel >::intersection ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

◆ intersection() [2/3]

template<class PointType, class LabelType>
template<class ResultNumber, PointConcept OtherPoint>
std::optional< Point< ResultNumber, typename PointType::LabelType > > pgl::Disk< PointType, LabelType >::intersection ( const OtherPoint & other) const
nodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), empty when they are disjoint.

Template Parameters
ResultNumberCoordinate type of the returned point.
OtherPointPoint type.
Parameters
otherPoint to intersect with.
Returns
The point when contained, otherwise empty.

◆ intersection() [3/3]

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>, PointConcept OtherPoint>
auto pgl::Disk< PointType_, TLabel >::intersection ( const Shape< OtherPoint > & other) const
inlinenodiscardconstexpr

Returns the intersection of the two shapes (A ∩ B), re-dispatching through the wrapper's own intersection.

An intersection is symmetric, so this just calls other's own intersection, which visits its wrapped alternative and throws if the pair is unsupported.

The point type is deduced from other so a plain concrete shape cannot reach this overload through an implicit conversion to Shape.

Returns
The intersection wrapped in a Shape, rather than the tighter type the concrete pair would answer with: which alternative other holds is not known until run time, so neither is the result's.

◆ intersects() [1/13]

template<class PointType_, class TLabel>
template<class EmptyPoint>
bool pgl::Disk< PointType_, TLabel >::intersects ( const EmptyShape< EmptyPoint > & ) const
inlinenodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [2/13]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

True when the distance between the centers is at most the sum of the radii (touching disks count as intersecting).

◆ intersects() [3/13]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [4/13]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherLine & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [5/13]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [6/13]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [7/13]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [8/13]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherRay & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [9/13]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [10/13]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [11/13]

template<class PointType_, class TLabel>
template<typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk>)
bool pgl::Disk< PointType_, TLabel >::intersects ( const OtherShape & other) const
inlinenodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [12/13]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::intersects ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ intersects() [13/13]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::intersects ( const Shape< OtherPoint > & other) const
nodiscardconstexpr

Tests whether this shape and the other shape intersect (A ∩ B ≠ ∅).

◆ isDegenerate()

template<class PointType_, class TLabel>
bool pgl::Disk< PointType_, TLabel >::isDegenerate ( ) const
inlineconstexpr

Returns whether the three boundary points are collinear.

◆ isPoint()

template<class PointType_, class TLabel>
bool pgl::Disk< PointType_, TLabel >::isPoint ( ) const
inlinenodiscardconstexpr

Returns whether the disk collapses to a single point.

True when all three boundary points coincide, i.e. the disk has zero radius.

Complexity: O(1).

◆ isUndefined()

template<class PointType_, class TLabel>
bool pgl::Disk< PointType_, TLabel >::isUndefined ( ) const
inlinenodiscardconstexpr

Returns whether the disk is degenerate without collapsing to a point.

True when the boundary points are collinear but not all equal, so they do not determine a circle: three distinct collinear points have no circle through them, and two distinct ones (a repeated point) have infinitely many. A disk never collapses to a segment, so together with isPoint this covers every degenerate disk.

Complexity: O(1).

◆ label()

template<class PointType_, class TLabel>
template<class A = LabelType>
requires (detail::has_label_v<A>)
A & pgl::Disk< PointType_, TLabel >::label ( ) const
inlineconstexpr

Returns the disk label.

The label is mutable even through a const disk: it is metadata that does not participate in equality, hashing, or geometric predicates.

Returns
Reference to the stored label.

◆ latticePoints()

template<class PointType, class LabelType>
requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
template<class ResultNumber>
requires (detail::extended_integral<ResultNumber> || std::same_as<ResultNumber, BigInt>)
std::vector< Point< ResultNumber, typename PointType::LabelType > > pgl::Disk< PointType, LabelType >::latticePoints ( ) const
nodiscard

Returns the integer points the disk contains.

The boundary included: a point at distance exactly the radius is a point of the disk. Each column of the bounding box meets the disk in one run of rows, grown from the row nearest the centre by the disk's own exact containment test, so no square root is taken and nothing is rounded.

Template Parameters
ResultNumberInteger coordinate type of the points: the shape's own coordinate type when that is a signed integer, the integer a pgl::Rational is built on, and int64_t for anything else.
Returns
The lattice points, in increasing order, carrying no label.
Exceptions
std::logic_errorIf a coordinate is not finite, a lattice point of the shape does not fit ResultNumber.
std::length_errorIf there are more of them than a vector holds.

◆ minkowskiErosion() [1/5]

template<class PointType_, class TLabel>
template<class ResultNumber, DiskConcept OtherDisk>
std::optional< Disk< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > > pgl::Disk< PointType_, TLabel >::minkowskiErosion ( const OtherDisk< PointType_, TLabel > & other) const

◆ minkowskiErosion() [2/5]

template<class PointType_, class TLabel>
template<class ResultNumber = double, DiskConcept OtherDisk>
std::optional< Disk< Point< ResultNumber, PointLabelType > > > pgl::Disk< PointType_, TLabel >::minkowskiErosion ( const OtherDisk< PointType_, TLabel > & other) const
nodiscard

Returns the Minkowski erosion of this disk by another (A ⊖ B), a disk when there is one.

The mirror of minkowskiSum(const OtherDisk&) const, and the same one curved pair the library can answer: the centres subtract and so do the radii, since a support function subtracts under the erosion exactly as it adds under the sum. The operand is the wider disk exactly when the difference of radii is negative, and then nothing fits: that is the std::nullopt, the typed spelling of an empty result for a shape with no empty state.

This one is not exact by default, and cannot be, for the reason minkowskiSum(const OtherDisk&) const gives: a disk stores three boundary points, so each radius is a square root of a stored quantity. ResultNumber therefore defaults to double, and a disk built from a centre and a radius is the common case that stays exact.

Template Parameters
ResultNumberCoordinate type of the result.
Parameters
otherThe disk to erode by.
Returns
The erosion as a disk, or std::nullopt when the operand is wider than this disk.
Warning
Takes a square root unless both disks were created from a centre and a radius.

◆ minkowskiErosion() [3/5]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
EmptyShape< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > pgl::Disk< PointType_, TLabel >::minkowskiErosion ( const OtherHalfplane & other) const

◆ minkowskiErosion() [4/5]

template<class PointType_, class TLabel>
template<class ResultNumber = double, HalfplaneConcept OtherHalfplane>
EmptyShape< Point< ResultNumber, PointLabelType > > pgl::Disk< PointType_, TLabel >::minkowskiErosion ( const OtherHalfplane & other) const
nodiscard

Returns the Minkowski erosion of this disk by a half-plane (A ⊖ B), which is empty.

A half-plane is unbounded and a disk is not, so no translate of one fits inside one: the pair whose erosion is the empty set by its types alone, which is why it is the one erosion that answers with an EmptyShape. The sum of the same pair is the half-plane itself; see minkowskiSum(const OtherHalfplane&) const.

Template Parameters
ResultNumberCoordinate type of the result.
Parameters
otherThe half-plane to erode by.
Returns
The empty shape.

◆ minkowskiErosion() [5/5]

template<class PointType, class LabelType>
requires MinkowskiSummableConcept<Disk<PointType_, TLabel>, OtherShape>
template<class OtherShape>
requires MinkowskiSummableConcept<Disk<PointType_, TLabel>, OtherShape>
auto pgl::Disk< PointType, LabelType >::minkowskiErosion ( const OtherShape & other) const
nodiscardconstexpr

Returns the Minkowski erosion of this shape by another (A ⊖ B).

The erosion is the point set {x : x ⊕ B ⊆ A}, the translations of other that keep it inside this shape – equivalently ⋂ {A - b : b ∈ B}. It is the morphological dual of minkowskiSum and is defined for the same pairs, but it is not commutative.

Eroding by a Point is the translation by its negation, so it returns this shape's own type; the other pairs come back as the convex region they are, a HalfplaneIntersection, which holds a lower-dimensional erosion and the empty one as readily as a two-dimensional one. A disk erodes to a disk, by an operand that is one.

Eroding by a shape that covers no point is the whole plane, which a HalfplaneIntersection returns and the tighter result types cannot.

Template Parameters
OtherShapeType of the shape to erode by.
Parameters
otherShape to erode by.
Returns
The erosion, in the tightest type that represents it.

◆ minkowskiSum() [1/5]

template<class PointType_, class TLabel>
template<class ResultNumber, DiskConcept OtherDisk>
Disk< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > pgl::Disk< PointType_, TLabel >::minkowskiSum ( const OtherDisk< PointType_, TLabel > & other) const

◆ minkowskiSum() [2/5]

template<class PointType_, class TLabel>
template<class ResultNumber = double, DiskConcept OtherDisk>
Disk< Point< ResultNumber, PointLabelType > > pgl::Disk< PointType_, TLabel >::minkowskiSum ( const OtherDisk< PointType_, TLabel > & other) const
nodiscard

Returns the Minkowski sum of the two disks (A ⊕ B), a disk.

The one pair of curved operands the library can answer: the centers add and so do the radii, since the support function of a disk is n·c + r|n| and support functions add under the sum. Nothing else a disk meets has a representable sum — a disk and a segment sweep a stadium, a disk and a polygon a rounded one, and neither is a shape here.

This one is not exact by default, and cannot be. The sum's radius is r₁ + r₂, and a disk stores three boundary points rather than a centre and a radius, so each rᵢ is a square root of a stored quantity: two integer disks generally have an irrational sum radius, which no exact coordinate type holds. That is why ResultNumber defaults to double here, as it does on radius and distance, rather than to the exact division_result_t the polygonal sums default to.

The exception is worth knowing because it is common: a disk built from a centre and a radius carries both exactly, so a sum of two such disks with an exact ResultNumber is exact, and no square root is taken. Ask for an exact type on a disk built from three boundary points and the square root reports itself the way radius does — by throwing, since std::sqrt is not available for the requested type.

Template Parameters
ResultNumberCoordinate type of the result.
Parameters
otherThe disk to sum with.
Returns
The sum, as a disk.
Warning
Takes a square root unless both disks were created from a centre and a radius.

◆ minkowskiSum() [3/5]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
Halfplane< Point< ResultNumber, typename Disk< PointType_, TLabel >::PointLabelType > > pgl::Disk< PointType_, TLabel >::minkowskiSum ( const OtherHalfplane & other) const

◆ minkowskiSum() [4/5]

template<class PointType_, class TLabel>
template<class ResultNumber = double, HalfplaneConcept OtherHalfplane>
Halfplane< Point< ResultNumber, PointLabelType > > pgl::Disk< PointType_, TLabel >::minkowskiSum ( const OtherHalfplane & other) const
nodiscard

Returns the Minkowski sum of this disk and a half-plane (A ⊕ B), a half-plane.

The mirror spelling of Halfplane::minkowskiSum(const OtherDisk&) const, which carries the contract and the same square root: the boundary keeps its direction and slides out by this disk's radius along the outward unit normal. A half-plane absorbs whatever is bounded, a disk included.

◆ minkowskiSum() [5/5]

template<class PointType, class LabelType>
requires MinkowskiSummableConcept<Disk<PointType_, TLabel>, OtherShape>
template<class OtherShape>
requires MinkowskiSummableConcept<Disk<PointType_, TLabel>, OtherShape>
auto pgl::Disk< PointType, LabelType >::minkowskiSum ( const OtherShape & other) const
nodiscardconstexpr

Returns the Minkowski sum of this shape and another (A ⊕ B).

The sum is the point set {a + b : a ∈ A, b ∈ B}. Summing with a Point is a translation, so it returns this shape's own type; two bounded convex shapes sum to a Convex, or to a Rectangle when both are rectangles. See MinkowskiSummableConcept for the pairs a Minkowski sum is defined for.

Template Parameters
OtherShapeType of the other shape.
Parameters
otherShape to sum with.
Returns
The Minkowski sum, in the tightest type that represents it.

◆ operator*=()

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
Disk & pgl::Disk< PointType_, TLabel >::operator*= ( const Scalar & scalar)
inlineconstexpr

Scales every boundary point by scalar in place.

Warning
Re-canonicalizes the points (a negative scalar flips orientation).
Returns
Reference to this disk.

◆ operator+=()

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
Disk & pgl::Disk< PointType_, TLabel >::operator+= ( const OtherPoint & translation)
inlineconstexpr

Translates the disk by translation in place.

Returns
Reference to this disk.

◆ operator-=()

template<class PointType_, class TLabel>
template<PointConcept OtherPoint>
Disk & pgl::Disk< PointType_, TLabel >::operator-= ( const OtherPoint & translation)
inlineconstexpr

Translates the disk by -translation in place.

Returns
Reference to this disk.

◆ operator/=()

template<class PointType_, class TLabel>
template<class Scalar>
requires (!detail::is_point_v<Scalar> && !TransformationConcept<Scalar>)
Disk & pgl::Disk< PointType_, TLabel >::operator/= ( const Scalar & scalar)
inlineconstexpr

Divides every boundary point by scalar in place.

Warning
Re-canonicalizes the points; integer division truncates coordinates.
Returns
Reference to this disk.

◆ operator<=>()

template<class PointType_, class TLabel>
std::partial_ordering pgl::Disk< PointType_, TLabel >::operator<=> ( const Disk< PointType_, TLabel > & other) const
inlineconstexpr

Orders disks by increasing squared radius, then by center.

The radius and the center are computed in division_result_t, not in NumberType. Both are fractions of the boundary coordinates – generally non-integral even for an integer disk – so asking for them in an integral NumberType would truncate, and two circles with different radii or centers could truncate to the same pair and compare equivalent while operator== correctly reported them unequal. All three of <, == and > were then false for such a pair, which is not an ordering at all: it breaks std::set<Disk> and anything else that sorts. Computing exactly makes equivalence here mean the same thing as operator== – same center and same radius is the same circle.

Warning
Uses division through squaredRadius() and center().

◆ operator=()

template<class PointType_, class TLabel>
template<PointConcept OtherPointType, class OtherLabelType>
requires (std::constructible_from<PointType, const OtherPointType&>)
Disk & pgl::Disk< PointType_, TLabel >::operator= ( const Disk< OtherPointType, OtherLabelType > & other)
inlineconstexpr

Assigns from a disk with compatible point and label types.

Template Parameters
OtherPointTypeSource boundary point type.
OtherLabelTypeSource label type.
Parameters
otherDisk to copy from; its points are re-canonicalized.
Returns
Reference to this disk.

◆ operator==()

template<class PointType_, class TLabel>
bool pgl::Disk< PointType_, TLabel >::operator== ( const Disk< PointType_, TLabel > & other) const
inlineconstexpr

Returns whether two disks describe the same closed region.

Two circles compare equal when other's three boundary points all lie on this disk's boundary (exact in-circle test).

◆ operator[]()

template<class PointType_, class TLabel>
const PointType & pgl::Disk< PointType_, TLabel >::operator[] ( std::size_t index) const
inlineconstexpr

Returns boundary point index in canonical order.

Parameters
indexPosition in [0, 3); out-of-range is undefined (asserted in debug).

◆ pointInside()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
Point< ResultNumber, PointLabelType > pgl::Disk< PointType_, TLabel >::pointInside ( ) const
inlinenodiscardconstexpr

Returns the midpoint of the first two boundary points.

Being the midpoint of a chord, it lies strictly inside the disk.

Template Parameters
ResultNumberCoordinate type of the result; defaults to division_result_t.
Warning
Divides by 2; with an integral ResultNumber the truncated result may land on or outside the boundary.

◆ pointInsideInteriorContainedIn()

template<class PointType_, class TLabel>
template<class OtherShape>
bool pgl::Disk< PointType_, TLabel >::pointInsideInteriorContainedIn ( const OtherShape & shape) const
inlinenodiscardconstexpr

Tests whether some point strictly inside this disk lies in the strict interior of shape.

The witness used by the interiorsIntersect overloads for the case where the disk lies inside a convex shape (no boundary of shape crosses the open disk). pointInside is the chord midpoint — a single division by 2 — so for integral coordinates the truncated midpoint may round onto or outside the boundary. When that happens (the rounded point is not strictly inside the disk) scaling the disk and shape by 2 makes the midpoint exact, leaving the containment relation unchanged.

◆ radius()

template<class PointType_, class TLabel>
template<class ResultNumber = double>
ResultNumber pgl::Disk< PointType_, TLabel >::radius ( ) const
inlinenodiscardconstexpr

Returns the radius.

Template Parameters
ResultNumberResult type.
Warning
If the disk has not been defined by center and radius, it takes a square root of squaredRadius, which uses division.

◆ rotate90()

template<class PointType, class LabelType>
void pgl::Disk< PointType, LabelType >::rotate90 ( int k = 1)
constexpr

Rotates the disk by 90k degrees around the origin in place.

Parameters
kNumber of 90-degree CCW rotations (may be negative).

◆ rotated90()

template<class PointType, class LabelType>
Disk< PointType, LabelType > pgl::Disk< PointType, LabelType >::rotated90 ( int k = 1) const
nodiscardconstexpr

Returns the disk rotated by 90k degrees around the origin.

Parameters
kNumber of 90-degree CCW rotations (may be negative).
Returns
Rotated disk.

◆ samePointSet()

template<class PointType, class LabelType>
template<AnyShapeConcept OtherShape>
bool pgl::Disk< PointType, LabelType >::samePointSet ( const OtherShape & other) const
nodiscardconstexpr

Tests whether another shape defines exactly the same point set.

◆ separates() [1/17]

template<class PointType, class LabelType>
template<MonotoneChainConcept OtherChain>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherChain & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [2/17]

template<class PointType, class LabelType>
template<ConvexConcept OtherConvex>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherConvex & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [3/17]

template<class PointType, class LabelType>
template<DiskConcept OtherDisk>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherDisk< PointType_, TLabel > & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [4/17]

template<class PointType, class LabelType>
template<HalfplaneConcept OtherHalfplane>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherHalfplane & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [5/17]

template<class PointType, class LabelType>
template<LineConcept OtherLine>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherLine & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [6/17]

template<class PointType, class LabelType>
template<OrientedLineConcept OtherOrientedLine>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherOrientedLine & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [7/17]

template<class PointType, class LabelType>
template<OrientedSegmentConcept OtherOrientedSegment>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherOrientedSegment & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [8/17]

template<class PointType, class LabelType>
template<PointConcept OtherPoint>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherPoint & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

Disk

A disk separates a segment when it crosses the segment's interior, leaving a surviving piece on each side.

◆ separates() [9/17]

template<class PointType, class LabelType>
template<PolygonConcept OtherPolygon>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherPolygon & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [10/17]

template<class PointType, class LabelType>
template<PolylineConcept OtherPolyline>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherPolyline & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [11/17]

template<class PointType, class LabelType>
template<RayConcept OtherRay>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherRay & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [12/17]

template<class PointType, class LabelType>
template<RectangleConcept OtherRectangle>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherRectangle & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [13/17]

template<class PointType, class LabelType>
template<PolygonWithHolesConcept OtherRegion>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherRegion & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

The cell engine that settles the other region pairs wants both boundaries as triangulation constraints, which a circle cannot be. What replaces it is the disk's convexity: it meets every cell of the region in one piece, so the components of A ∖ D are counted over the surviving vertices of the region's domain triangles and slits. See implementation/separates.hpp.

◆ separates() [14/17]

template<class PointType, class LabelType>
template<HalfplaneIntersectionConcept OtherRegion>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherRegion & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [15/17]

template<class PointType, class LabelType>
template<SegmentConcept OtherSegment>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherSegment & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ separates() [16/17]

template<class PointType, class LabelType>
template<PolygonSetConcept OtherSet>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherSet & other) const
nodiscard

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

A set of regions is the one target that may already be in several pieces before anything is removed, so this neither folds over its components nor answers false for a remover that misses it. See implementation/separates.hpp.

◆ separates() [17/17]

template<class PointType, class LabelType>
template<TriangleConcept OtherTriangle>
bool pgl::Disk< PointType, LabelType >::separates ( const OtherTriangle & other) const
nodiscardconstexpr

Tests whether removing this shape disconnects the other shape (B∖A is disconnected).

◆ size()

template<class PointType_, class TLabel>
constexpr std::size_t pgl::Disk< PointType_, TLabel >::size ( )
inlinestaticconstexpr

Returns the number of stored boundary points (always 3).

◆ squaredDistance() [1/11]

template<class PointType_, class TLabel>
template<class ResultNumber, DiskConcept OtherDisk>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherDisk< PointType_, TLabel > & other) const
nodiscard

Returns the squared Euclidean distance between two disks.

Zero when the disks intersect (touching counts); otherwise the square of distance(centers) - radius - other.radius. Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double.

◆ squaredDistance() [2/11]

template<class PointType_, class TLabel>
template<class ResultNumber, HalfplaneConcept OtherHalfplane>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherHalfplane & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [3/11]

template<class PointType_, class TLabel>
template<class ResultNumber, LineConcept OtherLine>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherLine & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [4/11]

template<class PointType_, class TLabel>
template<class ResultNumber, OrientedLineConcept OtherOrientedLine>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherOrientedLine & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [5/11]

template<class PointType_, class TLabel>
template<class ResultNumber, OrientedSegmentConcept OtherOrientedSegment>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherOrientedSegment & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [6/11]

template<class PointType_, class TLabel>
template<class ResultNumber, PointConcept OtherPoint>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherPoint & point) const
nodiscard

Returns the squared Euclidean distance from this disk to a point.

Zero when the disk contains the point (boundary inclusive); otherwise the square of |point - center| - radius, the gap between the point and the nearest point of the circle.

Reports in detail::floating_result_t<ResultNumber>: the distance to an exterior point is generally irrational, so unlike the other shapes an exact ResultNumber cannot be honoured. A floating-point one is used as asked; anything else falls back to double.

◆ squaredDistance() [7/11]

template<class PointType_, class TLabel>
template<class ResultNumber, RayConcept OtherRay>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherRay & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [8/11]

template<class PointType_, class TLabel>
template<class ResultNumber, RectangleConcept OtherRectangle>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherRectangle & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [9/11]

template<class PointType_, class TLabel>
template<class ResultNumber, SegmentConcept OtherSegment>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherSegment & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredDistance() [10/11]

template<class PointType_, class TLabel>
template<class ResultNumber = double, typename OtherShape>
requires (!PointConcept<OtherShape> && detail::shapeRank<OtherShape> > detail::shapeRank<Disk> && requires(const OtherShape& o,
const Disk& self) { o.squaredDistance(self); })
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherShape & other) const
inlinenodiscard

Returns the squared Euclidean distance to the given shape.

Forwards to the other shape's implementation so that each unordered pair needs squaredDistance defined only once, on the higher-ranked shape (the shapes ranked above Disk are Convex and Polygon).

◆ squaredDistance() [11/11]

template<class PointType_, class TLabel>
template<class ResultNumber, TriangleConcept OtherTriangle>
detail::floating_result_t< ResultNumber > pgl::Disk< PointType_, TLabel >::squaredDistance ( const OtherTriangle & other) const
nodiscard

Returns the squared Euclidean distance from this disk to a shape.

Zero when the disk and the shape intersect; otherwise the square of distance(center, shape) - radius, the gap between the shape and the nearest point of the circle. Because the disk is the set of points within radius of the center, this gap is the disk-to-shape distance.

Reports in detail::floating_result_t<ResultNumber>: the gap to a circle is generally irrational, so a floating-point ResultNumber is honoured as asked and any other request falls back to double. The lower-ranked shapes forward their squaredDistance(Disk) to this overload.

◆ squaredRadius()

template<class PointType_, class TLabel>
template<class ResultNumber = division_result_t<NumberType>>
ResultNumber pgl::Disk< PointType_, TLabel >::squaredRadius ( ) const
inlinenodiscardconstexpr

Returns the squared radius in an explicitly chosen result type.

Template Parameters
ResultNumberResult type.
Warning
If the disk has not been defined by center and radius, it uses the circumradius formula, which divides by the squared area.