computeDistanceLineLine method
Implementation
double computeDistanceLineLine(
FacetSequence facetSeq, List<GeometryLocation?>? locs) {
// both linear - compute minimum segment-segment distance
double minDistance = double.maxFinite;
if (start != null && end != null) {
for (int? i = start!; i! < end! - 1; i++) {
Coordinate p0 = pts.getCoordinate(i);
Coordinate p1 = pts.getCoordinate(i + 1);
if (facetSeq.start != null && facetSeq.end != null) {
for (int j = facetSeq.start!; j < facetSeq.end! - 1; j++) {
Coordinate q0 = facetSeq.pts.getCoordinate(j);
Coordinate q1 = facetSeq.pts.getCoordinate(j + 1);
double dist = Distance.segmentToSegment(p0, p1, q0, q1);
if (dist < minDistance) {
minDistance = dist;
if (locs != null)
updateNearestLocationsLineLine(
i, p0, p1, facetSeq, j, q0, q1, locs);
if (minDistance <= 0.0) return minDistance;
}
}
}
}
}
return minDistance;
}