/*poj 1474 Video Surveillance - 求多边形有没有核*/#include #include const double eps=1e-8;const int N=103;struct point{ double x,y;}dian[N];inline bool mo_ee(double x,double y){ double ret=x-y; if(ret<0) ret=-ret; if(ret y + eps;} // x > yinline bool mo_ll(double x,double y) { return x < y - eps;} // x < yinline bool mo_ge(double x,double y) { return x > y - eps;} // x >= yinline bool mo_le(double x,double y) { return x < y + eps;} // x <= yinline double mo_xmult(point p2,point p0,point p1)//p1在p2左返回负,在右边返回正{ return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);}point mo_intersection(point u1,point u2,point v1,point v2){ point ret=u1; double t=((u1.x-v1.x)*(v1.y-v2.y)-(u1.y-v1.y)*(v1.x-v2.x)) /((u1.x-u2.x)*(v1.y-v2.y)-(u1.y-u2.y)*(v1.x-v2.x)); ret.x+=(u2.x-u1.x)*t; ret.y+=(u2.y-u1.y)*t; return ret;}///切割法求半平面交point mo_banjiao_jiao[N*2];point mo_banjiao_jiao_temp[N*2];void mo_banjiao_cut(point *ans,point qian,point hou,int &nofdian){ int i,k; for(i=k=0;i