distancePointToSegment function

double distancePointToSegment(
  1. Offset point,
  2. Offset a,
  3. Offset b
)

Returns the shortest distance from point to the segment a-b.

Implementation

double distancePointToSegment(Offset point, Offset a, Offset b) {
  return math.sqrt(distanceSquaredPointToSegment(point, a, b));
}