![]() |
Pangolin
Header-only C++20 plane computational geometry library
|
Manhattan (L1) distance between shapes. More...
Go to the source code of this file.
Namespaces | |
| namespace | pgl |
Macros | |
| #define | PGL_HPI_DISTANCE_L1(ConceptName, ArgType) |
Manhattan (L1) distance between shapes.
Mirrors the shape coverage of distance.hpp's squaredDistance, but for the L1 metric |dx| + |dy| instead of the Euclidean one. Every overload is templated on a ResultNumber coordinate type exactly like squaredDistance, and shares its caveat: an integer ResultNumber divides (and therefore truncates) whenever the true distance is fractional, which happens for any segment/ray/line that isn't axis-aligned. Request a floating-point or pgl::Rational ResultNumber for an accurate result.
L1 and LInf are implemented independently in this file and in distancelinf.hpp respectively – neither is derived from the other via a coordinate transform.
| #define PGL_HPI_DISTANCE_L1 | ( | ConceptName, | |
| ArgType ) |