import math


def rotate(x, y, xo, yo, theta):
    """rotate x,y around xo,yo by theta (rad)"""
    xr = math.cos(theta) * (x - xo) - math.sin(theta) * (y - yo) + xo
    yr = math.sin(theta) * (x - xo) + math.cos(theta) * (y - yo) + yo
    return [xr, yr]