/** * Compute the width information for a ring of {@link Coordinate}s. * Leaves the width information in the instance variables. * * @param pts */ private void computeConvexRingMinDiameter(Coordinate[] pts) { // for each segment in the ring minWidth = Double.MAX_VALUE; int currMaxIndex = 1; LineSegment seg = new LineSegment(); // compute the max distance for all segments in the ring, and pick the minimum for (int i = 0; i < pts.length - 1; i++) { seg.p0 = pts[i]; seg.p1 = pts[i + 1]; currMaxIndex = findMaxPerpDistance(pts, seg, currMaxIndex); } }