def _angle_round(angle):
    """ Round angle into one of four directions """

    if -22.5 < angle <= 22.5 or 157.5 < angle <= 202.5:
        return 0
    elif 22.5 < angle <= 67.5 or -157.5 < angle <= -112.5:
        return 45
    elif 67.5 < angle <= 112.5 or -112.5 < angle <= -67.5:
        return 90
    else:
        return 135