cartesianToPolar = (centerX, centerY, x, y) => {
  const radius = Math.sqrt(Math.pow(x - centerX, 2) + Math.pow(y - centerY, 2));
  let angleInDegrees = radiansToDegrees(Math.atan2(y - centerY, x - centerX));
  if (angleInDegrees < 0) {
    angleInDegrees += 360;
  }
  return { radius, angleInDegrees };
}
Convert cartesian coordinates to polar coordinates.

@param {number} centerX Center x coordinate.
@param {number} centerY Center y coordinate.
@param {number} x Point x coordinate.
@param {number} y Point y coordinate.
@returns {{radius: number, angleInDegrees: number}} Polar coordinates.