def getDirFromPts(p0,p1,p2):
    """
    Determines the directin of the path formed by following 
    points p0 -> p1 -> p2.
    """
    x0,y0 = p0
    x1,y1 = p1
    x2,y2 = p2
    ccwTest = (x1-x0)*(y2-y0) > (y1-y0)*(x2-x0)
    if ccwTest:
        return 'ccw'
    else:
        return 'cw'