import math


def rotate(x, y, cx, cy, angle):
    """
    Rotate a point around a center.

    >>> x, y = rotate(1, 1, 0, 0, 90)
    >>> print("x = {:.1f}, y = {:.1f}".format(x, y))
    x = -1.0, y = 1.0
    """
    temp_x = x - cx
    temp_y = y - cy

    # now apply rotation
    rotated_x = temp_x * math.cos(math.radians(angle)) - \
        temp_y * math.sin(math.radians(angle))
    rotated_y = temp_x * math.sin(math.radians(angle)) + \
        temp_y * math.cos(math.radians(angle))

    # translate back
    x = rotated_x + cx
    y = rotated_y + cy

    return x, y