distance method

double distance(
  1. FacetSequence facetSeq
)

Computes the distance between this and another FacetSequence.

@param facetSeq the sequence to compute the distance to @return the minimum distance between the sequences

Implementation

double distance(FacetSequence facetSeq) {
  bool isPoint = this.isPoint();
  bool isPointOther = facetSeq.isPoint();
  double distance;

  if (isPoint && isPointOther) {
    Coordinate pt = pts.getCoordinate(start!);
    Coordinate seqPt = facetSeq.pts.getCoordinate(facetSeq.start!);
    distance = pt.distance(seqPt);
  } else if (isPoint) {
    Coordinate pt = pts.getCoordinate(start!);
    distance = computeDistancePointLine(pt, facetSeq, null);
  } else if (isPointOther) {
    Coordinate seqPt = facetSeq.pts.getCoordinate(facetSeq.start!);
    distance = computeDistancePointLine(seqPt, this, null);
  } else {
    distance = computeDistanceLineLine(facetSeq, null);
  }
  return distance;
}