void CirAndCut(Point psn[],int n,Point psm[],int m)
{
int nid=0,mid=0;
for(int i=1;i<n;i++)
if(psn[i].y>psn[nid].y)
{
nid=i;
}
for(int i=1;i<m;i++)
if(psm[i].y<psm[mid].y)
{
mid=i;
}
//找到点集n中最上点,m中的最下点。
//l 为水平向右的向量
for(int ii=0;ii<n+m;ii++)
{
//第一步判断谁先 滚起来
Point nextn,nextm;
nextn = psn[(nid+1)%n];
nextm = psm[(mid+1)%m];
if( (nextn-psn[nid])*(psm[mid]-nextm)>0 )
{
//n先滚
nid = (nid+1)%n;
}
else
{
mid= (mid+1)%m;
}
//这里就可以得到对踵点
/*
Line l1,l2;
l1.p1 = psn[nid];
l1.p2 = psn[ (nid-1+n)%n ];
l2.p1 = psm[mid];
l2.p2 = psm[ (mid-1+m)%m ];
ans = min(ans,Dis(l1, l2));
*/
}
}