def is_left(p0, p1, p2):
    """
    Input:  three points P0, P1, and P2
    Return: > 0 for P2 left of the line through P0 to P1
            = 0 for P2 on the line
            < 0 for P2 right of the line
    """
    p0x, p0y = p0
    p1x, p1y = p1
    p2x, p2y = p2

    # logging.log(level=GEOM_ALG_INFO,
    #             msg=(p1x - p0x) * (p2y - p0y) - (p2x - p0x) * (p1y - p0y))
    return (p1x - p0x) * (p2y - p0y) - (p2x - p0x) * (p1y - p0y)