Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
distancelinf.hpp File Reference

Chebyshev (LInf) distance between shapes. More...

Go to the source code of this file.

Namespaces

namespace  pgl

Macros

#define PGL_HPI_DISTANCE_LINF(ConceptName, ArgType)

Detailed Description

Chebyshev (LInf) distance between shapes.

Mirrors the shape coverage of distancel1.hpp, but for the LInf metric max(|dx|, |dy|) instead of L1. Implemented independently of L1 (no coordinate-transform trick relating the two metrics) – the two files happen to share the same overall shape-recursion structure because that structure only relies on convexity, which both metrics have, not on any relationship between them.

Macro Definition Documentation

◆ PGL_HPI_DISTANCE_LINF

#define PGL_HPI_DISTANCE_LINF ( ConceptName,
ArgType )
Value:
template <class PointType, class LabelType> \
template <class ResultNumber, ConceptName ArgType> \
constexpr auto HalfplaneIntersection<PointType, LabelType>::distanceLInf( \
const ArgType& other) const { \
if (intersects(other)) { \
return ResultNumber{}; \
} \
return detail::regionEdgesDistanceLInf<ResultNumber>(*this, other); \
}