圆与直线的交点
point project(point a,point b,point c) { point base=b-a; double r=dot(base,c-a)/norm(base); return a+(base*r); } pair<point,point>getcrosspoints(point a,int r,point b,point c) { point pr=project(b,c,a); point e=(b-c)/ABS(b-c); double base=sqrt(r*r*1.0-norm(pr-a)); e=e*base; return make_pair(pr+e,pr-e); }