import math


def rotate_point(cx, cy, x, y, theta):
    """
    Rotates a point around another by some angle.

    Parameters
    ----------
    cx: float
        center x
    cy: float
        center y
    x: float
        point x
    y: float
        point y
    theta: float
        angle in radians

    Returns
    -------
    tuple
        2-tuple (x_rot, y_rot)
    """
    s, c = math.sin(theta), math.cos(theta)

    x -= cx
    y -= cy

    x_new = x * c - y * s
    y_new = x * s + y * c

    return x_new + cx, y_new + cy