import math


def angle_to_comp(n, deg=False):
    """Returns the complex number with a magnitude of 1 that forms an angle of n with the real axis

    n: angle as float \\
    deg: bool (if ```True```, n is taken to be in degrees, if ```False```, n is taken to be in radians)"""
    if deg:
        n = math.radians(n)
    return complex(math.cos(n), math.sin(n))