typedef struct
{
double x,y;
} Point;
double polygonarea(Point *polygon,int N)
{
int i,j;
double area = 0;
for (i=0;i<N;i++)
{
j = (i + 1) % N;
area += polygon[i].x * polygon[j].y;
area -= polygon[i].y * polygon[j].x;
}
area /= 2; return(area < 0 ? -area : area);
}