cdeck h0mer10 subroutine homr10 (coor,n,nhull,area,iwork) c this subroutine uses subroutine homr11 to determine the c coordinates of the minimum convex polygon, and then calculates c its area. c formal parameters c input c coor real array (2,n) (x,y) co-ordinates of the data c n integer total number of data points c work area c iwork integer work area of 5*n words c on output, the first nhull words of iwork c contain the subscripts of coor for the c vertices of the convex polygon in clockwise c order c output c nhull integer number of vertices in convex polygon c area real area of convex polygon dimension coor(3,n), iwork(1) do 10 i=1,n iwork(i)=n+1-i 10 continue call homr11 (n,coor,n,iwork,iwork(n+1),iwork(2*n+1),iwork(3*n+1) 1 ,nhull,iwork(4*n+1)) c loop to put indices of convex polygon (in counter-clockwise c order) into positions nhull+1 to 2*nhull of iwork ik=1 ymax=-9.9e30 do 30 i=1,nhull iwork(nhull+i)=iwork(3*n+ik) if (coor(2,iwork(nhull+i)).le.ymax) go to 20 ymax=coor(2,iwork(nhull+i)) imax=i 20 ik=iwork(4*n+ik) 30 continue c loop to reorder fixes in clockwise order, c starting with the maximum y coordinate do 40 i=1,nhull iwork(i)=iwork(nhull+imax) imax=imax-1 if (imax.eq.0) imax=nhull 40 continue c loop to calculate area of minimum convex polygon area=0. if (nhull.lt.3) go to 60 area=coor(1,iwork(1))*(coor(2,iwork(nhull))-coor(2,iwork(2))) 1 +coor(1,iwork(nhull))*(coor(2,iwork(nhull-1))-coor(2,iwork(1))) nhullm1=nhull-1 do 50 i=2,nhullm1 area=area+coor(1,iwork(i))*(coor(2,iwork(i-1))-coor(2,iwork(i+1 1 ))) 50 continue area=area*0.5 60 return end