随笔分类 -  计算几何

摘要:#include <iostream> #include <cmath> #define M_PI acos(-1.0) using namespace std; /* get angle ACB, point C is the center point A(x1,y1) B(x2,y2) C(x3 阅读全文
posted @ 2021-08-01 10:47 棉被sunlie 阅读(351) 评论(0) 推荐(0)
摘要:#include <iostream> #include <cstring> #include <iomanip> #include <algorithm> #include <queue> #include <stack> #include <vector> #include <set> #inc 阅读全文
posted @ 2021-07-19 20:51 棉被sunlie 阅读(41) 评论(0) 推荐(0)
摘要:struct node { double x,y; } p[MS]; node get_center(double x1,double y1,double x2,double y2,double x3,double y3) { double A,B,C,D,x,y,r; double x1x1 = 阅读全文
posted @ 2021-07-07 15:18 棉被sunlie 阅读(195) 评论(0) 推荐(0)
摘要:vector<Pair> calc(double x1 , double y1 , double r1 , double x2 , double y2 , double r2) { x1-=x2,y1-=y2; double S=x1*x1+y1*y1,a=(S+r2*r2-r1*r1)/2,D=S 阅读全文
posted @ 2021-06-05 18:43 棉被sunlie 阅读(127) 评论(0) 推荐(0)
摘要:前置 struct point { //存储点 double x,y; }; double cross(double x1,double y1,double x2,double y2){ //计算叉积 return (x1*y2-x2*y1); } double compare(point a,po 阅读全文
posted @ 2021-06-05 18:40 棉被sunlie 阅读(137) 评论(0) 推荐(0)
摘要:题链 退火法 #include <iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #define eps 1e-7 #define MS 50 using namespace std; 阅读全文
posted @ 2021-06-05 18:20 棉被sunlie 阅读(26) 评论(0) 推荐(0)
摘要:题链 #include<bits/stdc++.h>//O(n),最小圆覆盖 #define eps 1e-12 using namespace std; int n,m; struct node { double x, y; } s[500005]; node o;//圆心坐标 double ri 阅读全文
posted @ 2021-06-05 18:11 棉被sunlie 阅读(41) 评论(0) 推荐(0)