主要计算半平面交
//半平面交
struct halfplane:public Line
{
double angle;
halfplane(){
}
//表示向量 s->e 逆时针 (左侧) 的半平面
halfplane(Point ss,Point ee)
{
s=ss,e=ee;
}
halfplane(Line v)
{
s=v.s;
e=v.e;
}
void calc_angle(void)
{
angle=atan2(e.y-s.y,e.x-s.x);
}
bool operator <(const halfplane &b) const
{
return angle<b.angle;
}
};
struct halfplanes
{
int n;
halfplane hp[maxp];
Point p[maxp];
int que[maxp];
int st,ed;
halfplanes()
{
n=0;
}
void push