def ccw(x, y, z):
    """
    Counterclockwise angle formed by [x, y] and [x, z]
    Taken from https://stackoverflow.com/a/9997374
    """
    return (z[1] - x[1]) * (y[0] - x[0]) > (y[1] - x[1]) * (z[0] - x[0])