function getPointSegmentRelationship(x, y, start, end) {
  const x1 = start[0];
  const y1 = start[1];
  const x2 = end[0];
  const y2 = end[1];
  const dx = x2 - x1;
  const dy = y2 - y1;
  let along = 0;
  let px = x1;
  let py = y1;
  if (dx !== 0 || dy !== 0) {
    along = clamp(((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy), 0, 1);
    px += dx * along;
    py += dy * along;
  }

  sharedRel.along = along;
  sharedRel.squaredDistance = toFixed(squaredDistance(x, y, px, py), 10);
  return sharedRel;
}
@param {number} x The point x.
@param {number} y The point y.
@param {import("../coordinate.js").Coordinate} start The segment start.
@param {import("../coordinate.js").Coordinate} end The segment end.
@return {PointSegmentRelationship} The point segment relationship.  The returned object is
shared between calls and must not be modified by the caller.