import math


def rotate(x, y, beta):
    """
    Rotate vector(x,y) by beta radians counterclockwise
    https://matthew-brett.github.io/teaching/rotation_2d.html
    """
    x2 = math.cos(beta)*x - math.sin(beta)*y
    y2 = math.sin(beta)*x + math.cos(beta)*y
    return (x2, y2)