allows you to consider the point of a closed polygon (x0, y0) ... (xn, yn), you can calculate the area by a simple loop through the point using this formula
area += yi+y(i+1) * (x(i+1)-xi)/2
Just for clarification with x (i + 1) and y (i + 1) I mean the next point in the sequence. The loop should start at 0 and stop at the n-1 vertex (so the next point is always valid), and when the last point is reached, consider the ptn-pt0
area should be taken as abs, otherwise you can use the sign to check if the polygon is by clockwise or counterclockwise. I'm just adding a drawing to explain how it works, so you can expand it to handle different types of curves. Let's look at this picture: 
The idea is to calculate the area of the green polygon from the algebraic sum, the area of each trapezoid related to the edge of the polygon and the x axis, in this case the trapezoid is:
x0,y0 x1,y1 x1,0 x0,0 x1,y1 x2,y2 x2,0 x1,0 (-)x2,y2 x3,y3 x3,0 x2,0 (-)x3,y3 x4,y4 x4,0 x3,0 (-)x4,y4 x0,y0 x0,0 x4,0
the first two are positive, the last three are negative, and, as you see, the difference is the green part, that is, the necessary area. I'm not so good at drawing, but I’ll try to understand that the result is due to an overlapping trapezoid that works in an additive and subtractive way. Even if I showed a convex polygon in the drawing, the algo also works on concave polygons. In case the edge is not a segment as the first solution, you need to convert it to a list of segments using the parametric equation on the curve and select it, you will get a decent approxymation. The best solution is to consider the parametric function of the non-linear segment and integrate it along the X axis (calculate the area between the curve and the X axis) and sum it when I sum the area of the linear segments. This has some math involved, but you can find the help you need here . You just need to use the correct segment equation.