计算几何
Goodbye_yesterday
湖北大学计科18级
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UVa 11179
#include<bits/stdc++.h> using namespace std; struct Point { double x,y; Point(double x=0,double y=0):x(x),y(y){ } }; typedef Point Vector; Vector operator - (Point A,Point B)//重载运算符 { ...原创 2018-07-24 10:36:56 · 117 阅读 · 0 评论 -
二维计算几何模板
#include<bits/stdc++.h> 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)//重载运算...原创 2018-07-24 17:15:10 · 282 阅读 · 0 评论 -
UVa 11796
题后反思:复杂的问题总是可以考虑最简单的情况再加以变形,本题正是建立在解决简单的问题之上的,两条线段问最大距离-最小距离无疑是简单的,考察端点即可。而折线段恰好可以分解为多个线段,问题得以解决。 #include<bits/stdc++.h> using namespace std; struct Point { double x,y; Point(double x=...原创 2018-07-25 10:27:59 · 215 阅读 · 0 评论 -
UVA10652
凸包学会之后,本题应该并不困难。适合练手 #include<bits/stdc++.h> using namespace std; struct Point { double x,y; Point(double x=0,double y=0):x(x),y(y) { } }; typedef Point Vector; double torad(double deg...原创 2018-07-27 20:24:46 · 237 阅读 · 0 评论 -
点在多边形内的判定
算法的思路是从点处引出一条向右的射线,逆时针穿过时wn++,顺时针穿过时wn--,何为顺时针穿过呢,就是向量poly[i]-p在向量poly[i]-ploy[i+1]的顺时针方向,逆时针同理。 #include<bits/stdc++.h> using namespace std; struct Point { double x,y; Point(double x=0...原创 2018-07-28 11:14:53 · 325 阅读 · 0 评论
分享