import math


def quadrant(x):
    """Returns which quadrant of the unit circle x is in.
    """
    norm = x % (math.pi * 2)
    quad = x % (math.pi / 2)
    if 0 <= norm < math.pi / 2:  # first quadrant
        return 1
    elif math.pi / 2 <= norm < math.pi:  # second quadrant
        return 2
    elif math.pi <= norm < math.pi * (3 / 2):  # third quadrant
        return 3
    elif math.pi * (3 / 2) <= norm < math.pi * 2:  # fourth quadrant
        return 4