def determinant(point1, point2, point3):
    """
    Compute the determinant of three points, to determine the turn direction, 
    as a 3x3 matrix:
    [p1(x) p1(y) 1]
    [p2(x) p2(y) 1]
    [p3(x) p3(y) 1]

    :param point1: the first point coordinates as a [x,y] list
    :param point2: the second point coordinates as a [x,y] list
    :param point3: the third point coordinates as a [x,y] list
    :return: a value >0 if counter-clockwise, <0 if clockwise or =0 if collinear
    """
    return (point2[0] - point1[0]) * (point3[1] - point1[1]) \
           - (point2[1] - point1[1]) * (point3[0] - point1[0])