function squaredDistance(x1, y1, x2, y2) {
  const dx = x2 - x1;
  const dy = y2 - y1;
  return dx * dx + dy * dy;
}
Returns the square of the distance between the points (x1, y1) and (x2, y2).
@param {number} x1 X1.
@param {number} y1 Y1.
@param {number} x2 X2.
@param {number} y2 Y2.
@return {number} Squared distance.