function closestOnSegmentData(pointCoordinates, segmentData) {
  const geometry = segmentData.geometry;

  if (geometry.getType() === GeometryType.CIRCLE &&
  segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
    return geometry.getClosestPoint(pointCoordinates);
  }
  return closestOnSegment(pointCoordinates, segmentData.segment);
}
function closestOnSegmentData(pointCoordinates, segmentData) {
  const geometry = segmentData.geometry;

  if (geometry.getType() === GeometryType.CIRCLE &&
  segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
    return geometry.getClosestPoint(pointCoordinates);
  }
  return closestOnSegment(pointCoordinates, segmentData.segment);
}
function closestOnSegmentData ( pointCoordinates , segmentData ) { const geometry = segmentData . geometry ; if ( geometry . getType ( ) === GeometryType . CIRCLE && segmentData . index === CIRCLE_CIRCUMFERENCE_INDEX ) { return geometry . getClosestPoint ( pointCoordinates ) ; } return closestOnSegment ( pointCoordinates , segmentData . segment ) ; }
Returns the point closest to a given line segment.

@param {import("../coordinate.js").Coordinate} pointCoordinates The point to which a closest point
should be found.
@param {SegmentData} segmentData The object describing the line
segment which should contain the closest point.
@return {import("../coordinate.js").Coordinate} The point closest to the specified line segment.
Returns the point closest to a given line segment .
Returns the closest point on the given segmentData