How do you calculate the area of an irregular polygon? The algorithm should work for any concievable 2D polygon, irregular or not.

I can't find any code on google.

Thanks.