几何
Tczxw
这个作者很懒,什么都没留下…
展开
-
二维几何常用模板
#include using namespace std; struct Point { double x, y; Point(double x = 0, double y = 0): x(x), y(y) {} }; typedef Point Vector; Vector operator +(Vector A, Vector B)// { return Vector(A.x + B.原创 2015-11-04 21:23:05 · 355 阅读 · 0 评论 -
半平面求交——放置守卫
#include //using namespcace std; const int maxn = 1510; const double EPS = 1E-12; struct Point { double x, y; }; Point convex[maxn]; struct Line { Point a, b; double ang; }; Line l[maxn], st[maxn]原创 2015-11-21 10:04:47 · 379 阅读 · 0 评论 -
半平面求交——点在凸包外
#include using namespace std; const int maxn = 50010; const double EPS = 1e-8; struct Point { double x, y; }; Point p[maxn]; struct Line { Point a, b; }; Line l[maxn], st[maxn]; int n; double opera原创 2015-11-21 11:25:39 · 675 阅读 · 0 评论 -
最小圆覆盖——模板题
#include const int maxn = 1005; struct TPoint { double x, y; TPoint operator - (const TPoint &a) const { TPoint p1; p1.x = x - a.x; p1.y = y - a.y; return p1; } }; struct TCircle { doubl原创 2015-11-24 17:07:43 · 478 阅读 · 0 评论