def calculate_polygon_area(corners):
  """Calculate 2D polygon area with given corners. Corners are assumed to be ordered.

  Args:
    corners (Nx2 array): xy-coordinates of N corner points

  Returns:
    float: polygon area"""

  # Use the shoelace algorithm to calculate polygon's area
  psum = 0
  nsum = 0

  npoints = corners.shape[0]

  for i in range(npoints):
      j = (i + 1) % npoints
      psum += corners[i, 0] * corners[j, 1]
      nsum += corners[j, 0] * corners[i, 1]

  return abs(1/2*(psum - nsum))