def is_anticlockwise(points):
    """
    check if the polygon is anticlockwise
    Args:
        points: a list of 2D points representing the polygon!
    
    Returns: is anticlockwise or not 
    """
    sum = 0
    n = len(points)
    for i in range(n):
        x1, y1 = points[i][:2]
        x2, y2 = points[(i + 1) % n][:2]  # The next point, wrapping around to the first
        sum += (x2 - x1) * (y2 + y1)
    return sum > 0

    check if the polygon is anticlockwise
    Args:
        points: a list of 2D points representing the polygon!
    
    Returns: is anticlockwise or not 
    
metadrive/utils/vertex.py