Once you know how to compute the area of a triangle
, you can subdivide your polygon to find the total area.
Basically, take one vertex A, and for each edge B->C in the polygon, compute the area of the triangle formed by ABC, and sum the results.
This, however, will only work for convex polygons. To handle concave polygons you need to do a bit more work. For each edge B->C, you check which side A falls on
, and either add or subtract the area of the triangle to the total.
For instance, assuming you are iterating through the edges in a counter-clockwise direction, if A lies on the left hand side of B->C, you add the area of the triangle ABC, if on the right hand side, you subtract.