def turn(p1, p2, p3):
    """
    0 if the points are colinear
    1 if the points define a left-turn
    -1 if the points define a right-turn
    """
    # Compute the z-coordinate of the vectorial product p1p2 x p2p3
    z = (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (p3[0]- p1[0])
    return 0 if z == 0 else int(z / abs(z))