随笔分类 -  计算几何

刷kuangbin的题单
摘要:圆与多边形的面积交 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_H int sgn(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Poin 阅读全文
posted @ 2021-09-15 22:55 LaiYiC 阅读(100) 评论(0) 推荐(0)
摘要:两个圆的切线与切点 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_G int sgn(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Poin 阅读全文
posted @ 2021-09-15 20:38 LaiYiC 阅读(512) 评论(0) 推荐(0)
摘要:点到圆的切点 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_F int sgn(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Point { 阅读全文
posted @ 2021-09-15 16:25 LaiYiC 阅读(147) 评论(0) 推荐(0)
摘要:两圆交点 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_E int sgn(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Point { / 阅读全文
posted @ 2021-09-15 12:43 LaiYiC 阅读(165) 评论(0) 推荐(0)
摘要:问n条平行于x,y的直线交点个数 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/6/CGL_6_A struct Line { int st,ed,pos; Line() {} Line(int a,int b,int c) { st= 阅读全文
posted @ 2021-09-14 20:31 LaiYiC 阅读(68) 评论(0) 推荐(0)
摘要:给一个逆时针的凸包和一条线,问你线的左边的和凸包的交面积 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/4/CGL_4_C int n; Point p[N],ch[N]; Point last[N]; //最后存在的点 //两直线交点 阅读全文
posted @ 2021-09-14 05:30 LaiYiC 阅读(88) 评论(0) 推荐(0)
摘要:7 计算几何 7.1 二维几何 // `计算几何模板` const double eps = 1e-8; const double inf = 1e20; const double pi = acos(-1.0); const int maxp = 1010; //`Compares a doubl 阅读全文
posted @ 2021-09-09 06:23 LaiYiC 阅读(103) 评论(0) 推荐(0)
摘要:2017icpc沈阳 http://acm.hdu.edu.cn/showproblem.php?pid=6219 const int N = 1e2+50; int sgn(double x) { //判断x是否等于0 if(fabs(x) < eps) return 0; else return 阅读全文
posted @ 2021-09-08 21:08 LaiYiC 阅读(69) 评论(0) 推荐(0)
摘要:题意:逆时针绕圈,问最长怎么走 https://vjudge.net/problem/POJ-1696 int sgn(double x) { if(fabs(x) < eps)return 0; else return x<0?-1:1; } struct Point { double x,y; 阅读全文
posted @ 2021-08-27 15:14 LaiYiC 阅读(50) 评论(0) 推荐(0)
摘要:int sgn(double x) { if(fabs(x) < eps)return 0; else return x<0?-1:1; }; struct Point {double x,y;}; double Distance(Point A,Point B) {return hypot(A.x 阅读全文
posted @ 2021-07-29 01:39 LaiYiC 阅读(36) 评论(0) 推荐(0)
摘要:动态凸包,n次操作,添加一个点,或询问一个点是否在凸包内部. ps:询问每次更新后的凸包面积的板子在Hdu板子上. typedef long long ll; const int MOD = 1e9 + 7; const int INF = 0x7fffffff; const double eps 阅读全文
posted @ 2021-07-28 23:56 LaiYiC 阅读(82) 评论(0) 推荐(0)
摘要:凸包内最大三角形 #define ld double const ld eps = 1e-9; const ld PI =acos(-1); const int N = 2e5 + 50; int sgn(double x) { if(fabs(x) < eps)return 0; return x 阅读全文
posted @ 2021-07-28 19:04 LaiYiC 阅读(62) 评论(0) 推荐(0)
摘要:1.https://codeforces.com/problemset/problem/793/C 2300的计算几何真恶心啊 题意:n条射线,问全部到达一个矩形"内部"的时间 思路:1.如果p1在内部,那就只有一个时间点,如果在外部,射入会有一个或两个时间点. 2.获得一段时间段后,取交集. 注意 阅读全文
posted @ 2021-07-20 10:51 LaiYiC 阅读(53) 评论(0) 推荐(0)
摘要:计算几何 1.https://codeforces.com/problemset/problem/40/A 放到第一象限再判断 int n,k; struct Point { int x,y; int id; Point() {} Point(double x,double y):x(x),y(y) 阅读全文
posted @ 2021-07-18 22:09 LaiYiC 阅读(52) 评论(0) 推荐(0)
摘要:7.16 1.https://codeforces.com/problemset/problem/127/A 水题 2.https://codeforces.com/problemset/problem/136/D 八个点,分成一个长方形一个正方形,也可以两个正方形 展开 int n,k; stru 阅读全文
posted @ 2021-07-16 23:12 LaiYiC 阅读(40) 评论(0) 推荐(0)
摘要:求一段区间函数与x轴的面积问题 const double eps = 1e-7; double a,b,c,d,L,R; double f(double x) { return (c*x+d)/(a*x+b); } double simpson(double l,double r) { return 阅读全文
posted @ 2021-07-09 20:25 LaiYiC 阅读(35) 评论(0) 推荐(0)
摘要:三角形模板 const int N = 1e5 + 50; const ld PI = acos(-1.0); const ld eps=1e-8; int sgn(ld x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Point { 阅读全文
posted @ 2021-06-09 19:58 LaiYiC 阅读(64) 评论(0) 推荐(0)
摘要:K次圆覆盖问题 模板 #include<bits/stdc++.h> using namespace std; const int maxn=1009; const double eps=1e-8; const double pi=acos(-1); int dcmp(double x) {retu 阅读全文
posted @ 2021-06-04 00:03 LaiYiC 阅读(76) 评论(0) 推荐(0)
摘要:题意: 在10*10的范围,你每次站在一个点,会告诉你距离目标点变近了还是远了,每次输出可能的范围. 思路: 对于当前p[i]和前一次p[i-1],他的回答等于告诉你在p[i] - > p[i-1]这条线的中垂线的哪一边,先表示出这根中垂线,定义它的左边表示包含部分,然后用远近调整这条线的方向(经过 阅读全文
posted @ 2021-06-02 00:58 LaiYiC 阅读(48) 评论(0) 推荐(0)