@@ -67,26 +67,24 @@ coord_t AABB::distanceSquared(const Point2LL& p) const
6767 const Point2LL a = Point2LL (max_.X , min_.Y );
6868 const Point2LL b = Point2LL (min_.X , max_.Y );
6969 return (contains (p) ? -1 : 1 )
70- * std::min (
71- { LinearAlg2D::getDist2FromLineSegment (min_, a, p),
72- LinearAlg2D::getDist2FromLineSegment (a, max_, p),
73- LinearAlg2D::getDist2FromLineSegment (max_, b, p),
74- LinearAlg2D::getDist2FromLineSegment (b, min_, p) });
70+ * std::min ({ LinearAlg2D::getDist2FromLineSegment (min_, a, p),
71+ LinearAlg2D::getDist2FromLineSegment (a, max_, p),
72+ LinearAlg2D::getDist2FromLineSegment (max_, b, p),
73+ LinearAlg2D::getDist2FromLineSegment (b, min_, p) });
7574}
7675
7776coord_t AABB::distanceSquared (const AABB& other) const
7877{
79- return std::min (
80- {
81- distanceSquared (other.min_ ),
82- other.distanceSquared (min_),
83- distanceSquared (other.max_ ),
84- other.distanceSquared (max_),
85- distanceSquared (Point2LL (other.max_ .X , other.min_ .Y )),
86- other.distanceSquared (Point2LL (max_.X , min_.Y )),
87- distanceSquared (Point2LL (other.min_ .X , other.max_ .Y )),
88- other.distanceSquared (Point2LL (min_.X , max_.Y )),
89- });
78+ return std::min ({
79+ distanceSquared (other.min_ ),
80+ other.distanceSquared (min_),
81+ distanceSquared (other.max_ ),
82+ other.distanceSquared (max_),
83+ distanceSquared (Point2LL (other.max_ .X , other.min_ .Y )),
84+ other.distanceSquared (Point2LL (max_.X , min_.Y )),
85+ distanceSquared (Point2LL (other.min_ .X , other.max_ .Y )),
86+ other.distanceSquared (Point2LL (min_.X , max_.Y )),
87+ });
9088}
9189
9290void AABB::calculate (const Shape& shape)
0 commit comments