随笔分类 -  计算几何 - 计算几何基础

摘要:圆形 struct circle{ //圆心 Point p; //半径 double r; circle(){} circle(Point _p,double _r){ p = _p; r = _r; } circle(double x,double y,double _r){ p = Point 阅读全文
posted @ 2020-07-11 00:33 fxq1304 阅读(25) 评论(0) 推荐(0)
摘要:多边形 struct polygon{ int n; Point p[maxp]; Line l[maxp]; void input(int _n){ n=_n; for(int i=0;i< n;i++) p[i].input(); } void add(Point q){ p[n++]=q; } 阅读全文
posted @ 2020-07-11 00:32 fxq1304 阅读(17) 评论(0) 推荐(0)
摘要:直线与线段 struct Line{ Point s,e; Line(){} Line(Point _s,Point _e){ s = _s; e = _e; } bool operator == (Line v){ return (s==v.s) && (e==v.e); } //根据一个点和倾斜 阅读全文
posted @ 2020-07-11 00:25 fxq1304 阅读(18) 评论(0) 推荐(0)
摘要:计算几何基础 const double eps=1e-6; const double inf=1e20; const double pi=acos(-1.0); //符号函数 int sgn(double x){ if(fabs(x)<eps) return 0; if(x>0) return 1; 阅读全文
posted @ 2020-07-05 23:12 fxq1304 阅读(76) 评论(0) 推荐(0)