def rel_ordered(x1,x2,x3,x4):
    """
    given 4 collinear points, return true if the direction
    from x1->x2 is the same as x3=>x4
    requires x1!=x2, and x3!=x4
    """
    if x1[0]!=x2[0]:
        i=0 # choose a coordinate which is varying
    else:
        i=1
    assert x1[i]!=x2[i]
    assert x3[i]!=x4[i]
    return (x1[i]<x2[i]) == (x3[i]<x4[i])