www.pudn.com > zju_1000_1010.rar > 1010_temp.cpp


#include 
#include 
 const double preci=10e-12; 
 int same(double fir,double sec) 
 { 
	if(fabs(fir-sec)sec)     return fir; 
        else    return sec; 
 } 
 double min(double fir,double sec) 
 { 
        if(firmin(sec.start.x,sec.end.x)||same(max(fir.start.x,fir.end.x),min(sec.start.x,sec.end.x)))&& 
	   (max(sec.start.x,sec.end.x)>min(fir.start.x,fir.end.x)||same(max(sec.start.x,sec.end.x),min(fir.start.x,fir.end.x)))&& 
	   (max(fir.start.y,fir.end.y)>min(sec.start.y,sec.end.y))&& 
	   (max(sec.start.y,sec.end.y)>min(fir.start.y,fir.end.y))&& 
           (multiply(fir.start,sec.start,sec.end)*multiply(sec.start,fir.end,sec.end)>=0)&& 
           (multiply(sec.end,fir.start,fir.end)*multiply(fir.start,sec.start,fir.end)>=0)) 
           return 1; 
        return 0; 
 } 
 
 int ispoly(node point[],int n) 
 { 
        int i,j; 
        for(i=0;i>n) 
        { 
                if(n==0)        break; 
                count++; 
                if(count!=1)    cout<>point[i].x>>point[i].y; 
                cout<<"Figure "<