/**
 * Returns an array with the rotated x and y coordinates that's been rotated around a point
 * @param  x coordinate as number
 * @param  y coordinate as number
 * @param  deg rotation in degrees
 
 * @param  cx optional center points x coordinate as number, default = 0
 * @param  cy optional center points x coordinate as number, default = 0
 * @returns Coordinates representation - [x, y]
 */
export const rotateAroundAPoint = (x, y, deg, cx = 0, cy = 0) => {
    const radians = (Math.PI / 180) * deg;
    const cos = Math.cos(radians);
    const sin = Math.sin(radians);
    const nx = cos * (x - cx) + sin * (y - cy) + cx;
    const ny = cos * (y - cy) - sin * (x - cx) + cy;
    return [nx, ny];
};
//# sourceMappingURL=rotateAroundAPoint.js.map