1 * 2 *The vertices are saved as a matrix K (repeating the first one in the end). 3 *MATRIX K /// 4 *0 0 5 *4 1 6 *3 3 7 *2 2 8 *0 2 9 *1 1 10 *0 0 11 * 12 *Activate the following two commands: 13 *MAT SAVE K 14 *MAT DIM K 15 * 16 *P(x,y):=MAT_K(x,y) 17 *Area=for(i=1)to(rowK-1)sum((P(i,1)*P(i+1,2)-P(i+1,1)*P(i,2))/2) 18 * 19 *Area= 20 *GPLOT K.MAT,1,2 / LINE=POLYGON,5 GRID=1,1 Graph of a polygon 21 *
1 * 2 *The vertices are saved as a matrix K (repeating the first one in the end). 3 *MATRIX K /// 4 *0 0 5 *4 1 6 *3 3 7 *2 2 8 *0 2 9 *1 1 10 *0 0 11 * 12 *Activate the following two commands: 13 *MAT SAVE K 14 *MAT DIM K /* rowK=7 colK=2 15 * 16 *P(x,y):=MAT_K(x,y) 17 *Area=for(i=1)to(rowK-1)sum((P(i,1)*P(i+1,2)-P(i+1,1)*P(i,2))/2) 18 * 19 *Area=5.5 20 *GPLOT K.MAT,1,2 / LINE=POLYGON,5 GRID=1,1 Graph of a polygon 21 *