![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
几何数学
文章平均质量分 72
自ran而然
这个作者很懒,什么都没留下…
展开
-
Hdu 4667 凸包
题目链接:点击打开链接 这题主要是求点与圆的切点,圆与圆的切点。再用一下凸包就可以了。可以当模版求切点 // // main.cpp // 凸包 A // // Created by 宋健宇 on 17/2/10. // Copyright © 2017年 宋健宇. All rights reserved. #include #include #include #includ原创 2017-03-27 21:44:56 · 311 阅读 · 0 评论 -
圆的反演模版
Point inverse_Point(Point P,Point A,double r)//求A关于P反演 { Point O(0,0); Point PA=A-P; double len=r*r/dist(PA,O); Point A1=P+PA*(len/dist(PA,O)); return A1; }Circle inverse_Circle(Poi原创 2017-08-12 10:09:26 · 536 阅读 · 0 评论 -
圆与多边形求交面积
const int N=2000+10; const double eps=1e-10; const double PI=acos(-1.0); int rnd; int dcmp(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Point { double x,y; Point(){}原创 2017-07-31 16:41:54 · 589 阅读 · 0 评论 -
HDU 5484 Monitor the Alpacas 凸包+Dijkstra
题意 给你n个点 m个点 问m个点中最少几个 可以把 n个点围起来 思路:先凸包一下,然后 把凸包的线存起来,枚举m个点可组成的线段是否在凸包外面,然后 枚举m个点 最短环用Dijkstra就可以了 代码: #include #include #include #include #include #include #include using namespace std;原创 2017-07-01 20:44:06 · 472 阅读 · 0 评论 -
HDU 4573 Throw the Stones 三维凸包模版应用
点击打开链接 本题的意思:n孩子轮流扔石头构成三维凸包,求出第几个孩子扔的石子使三维凸包体积增量最大并输出体积增量 体积增量=Vi-Vi-1 (i代表第i个孩子扔石子,Vi-1 代表前i-1个孩子构成三维凸包的体积) 1 解题思路:如果直接暴力求增量的话复杂度n^2(1e8) 会超时。 那么我们可以根据三维凸包的增量法进行边输入点 边算出体积增量 同时维护凸包。我么知道石子原创 2017-06-02 12:40:39 · 575 阅读 · 0 评论 -
HDU 4316 凸包 +半平面交
题意:给出多边形的顶点,然后在天花板有三个摄像头,找出三个摄像头的盲区。 思路:每一个摄像头 对应有一个盲区,然后把三个摄像头的盲区取交集 然后求面积就可以 这里用到了 凸包模版和半平面交模版 代码: #include #include #include #include using namespace std; struct Point{ double x,y,z; Poi原创 2017-05-27 20:12:39 · 794 阅读 · 0 评论 -
HDU 4449 Building Design 三维凸包+空间坐标转换+二维凸包
题意:求点到面的最短距离的同时求出投影面积的最小 套一下模版 就好了 代码: #include #include #include #include #define eps 1e-7 using namespace std; const double inf=0x3f3f3f3f; const int MAXV=80; const double EPS = 1e-9; const原创 2017-05-03 10:07:03 · 748 阅读 · 0 评论 -
HDU 4548 Shoot the Airplane 计算几何
题意:给出 飞机的速度 和子弹的速度 问子弹是否可以打到飞机 思路 :就是判断点是否在多边形中 套一下模版就可以了 代码:#include #include using namespace std; const double eps=1e-9; double v,g,b; int n; struct Point { double x,y; Point(){} Point(原创 2017-04-13 22:34:29 · 367 阅读 · 0 评论 -
HDU 4454 Stealing a Cake (三分)
题意:给一个圆和一个矩形,再给一个点,求这个点到圆再到矩形的最短距离 。距离符合凸函数所以可以用 三分 #include #include #include using namespace std; const double eps = 1e-9; const double PI = acos(-1.0); struct Point { double x,y; }; struc原创 2017-04-13 00:45:11 · 344 阅读 · 0 评论 -
Gym 101308A Asteroids 三维凸包 求重心
题意:求两个凸包 重心离面的最短的距离之和 // // main.cpp // gudt p1 A // #include #include #include #define eps 1e-7 using namespace原创 2017-04-07 22:32:29 · 335 阅读 · 0 评论 -
Hdu 4617 立体几何 异面直线距离
题意:给出每个圆柱的截面,求出这些圆柱的最短距离 套一下模版就可以了 #include #include #include using namespace std; const double EPS = 1e-9; const int MAXN = 40; struct Point3 //空间点 { double x, y, z; Point3( double x=0,原创 2017-04-07 12:52:20 · 601 阅读 · 0 评论 -
计算几何模版
const double eps=1e-8;int dcmp(double x){ if (fabs(x)&amp;amp;lt;eps) { return 0; } else return x&amp;amp;lt;0?-1:1; }struct Point{ double x,y; Point(double x=0,double y=0):x(x),y(y) {} };typedef原创 2017-08-22 19:34:31 · 392 阅读 · 0 评论