struct point { double x,y; }; struct line { point a,b; }lines[110]; double chaji(point a,point b,point c,point d) { return (b.x-a.x)*(d.y-c.y)-(b.y-a.y)*(d.x-c.x); } bool isin(line l1,line l2) { if(chaji(l1.a,l2.a,l1.a,l1.b)*chaji(l1.a,l1.b,l1.a,l2.b)>=0&&chaji(l2.a,l1.b,l2.a,l2.b)*chaji(l2.a,l2.b,l2.a,l1.a)>=0) return true; return false; }
时间: 2024-10-09 09:49:04