41 distanceSquared(DoubleNotANumber),
52 initialize(
const geom::CoordinateXY& p0,
const geom::CoordinateXY& p1)
56 distanceSquared = p0.distanceSquared(p1);
63 return std::sqrt(distanceSquared);
66 const std::array<geom::CoordinateXY, 2>&
67 getCoordinates()
const
72 const geom::CoordinateXY&
73 getCoordinate(std::size_t i)
const
75 assert(i < pt.size());
82 setMaximum(ptDist.pt[0], ptDist.pt[1]);
86 setMaximum(
const geom::CoordinateXY& p0,
const geom::CoordinateXY& p1)
92 double distSq = p0.distanceSquared(p1);
93 if(distSq > distanceSquared) {
94 initialize(p0, p1, distSq);
101 setMinimum(ptDist.pt[0], ptDist.pt[1]);
105 setMinimum(
const geom::CoordinateXY& p0,
const geom::CoordinateXY& p1)
111 double distSq = p0.distanceSquared(p1);
112 if(distSq < distanceSquared) {
113 initialize(p0, p1, distSq);
132 initialize(
const geom::CoordinateXY& p0,
const geom::CoordinateXY& p1,
137 distanceSquared = distSquared;
141 std::array<geom::CoordinateXY, 2> pt;
143 double distanceSquared;