function rotate(coordinate, angle) {
  const cosAngle = Math.cos(angle);
  const sinAngle = Math.sin(angle);
  const x = coordinate[0] * cosAngle - coordinate[1] * sinAngle;
  const y = coordinate[1] * cosAngle + coordinate[0] * sinAngle;
  coordinate[0] = x;
  coordinate[1] = y;
  return coordinate;
}
Rotate `coordinate` by `angle`. `coordinate` is modified in place and
returned by the function.

Example:

    import {rotate} from 'ol/coordinate.js';

    const coord = [7.85, 47.983333];
    const rotateRadians = Math.PI / 2; // 90 degrees
    rotate(coord, rotateRadians);
    // coord is now [-47.983333, 7.85]

@param {Coordinate} coordinate Coordinate.
@param {number} angle Angle in radian.
@return {Coordinate} Coordinate.
@api