随笔分类 -  ACM——计算几何模板

摘要:/*给出三维空间中的n个顶点,求解由这n个顶点构成的凸包表面的多边形个数. 增量法求解:首先任选4个点形成的一个四面体,然后每次新加一个点,分两种情况: 1> 在凸包内,则可以跳过 2> 在凸包外,找到从这个点可以"看见"的面,删除这些面, 然后对于一边没有面的线段,和新加的这个点新建一个面,至于这 阅读全文
posted @ 2016-02-13 13:32 chenhuan001 阅读(358) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #include #include using namespace std; #define MAX_N 110 /*------------------常量区-------------------*/ const double INF = 1e10; // 无穷... 阅读全文
posted @ 2016-01-29 01:08 chenhuan001 阅读(623) 评论(0) 推荐(0) 编辑
摘要:void CirAndCut(Point psn[],int n,Point psm[],int m) { int nid=0,mid=0; for(int i=1;i<n;i++) if(psn[i].y>psn[nid].y) { nid=i; } for(int i=1;i<m;i++) if 阅读全文
posted @ 2016-01-28 13:32 chenhuan001 阅读(267) 评论(0) 推荐(0) 编辑
摘要://最小圆覆盖//输入: 从下标0开始的点集_ps和大小_n//输出: 覆盖所有点的最小圆//复杂度: O(n)//注意: 会对_ps进行随机处理操作,将会改变点集的内部顺序Circle MinCoverCir(Point _ps[],int _n){ //随机处理,但是会改变传入的点集。 ... 阅读全文
posted @ 2016-01-10 02:15 chenhuan001 阅读(261) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <cmath> #include <vector> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <algorithm> using namespace 阅读全文
posted @ 2015-12-31 11:45 chenhuan001 阅读(305) 评论(0) 推荐(0) 编辑
摘要:1. d维空间中一个规则几何体n刀最多能切成几块f(d,n)。f(d,n) = f(d,n-1) + f(d-1,n-1) 这不就是组合数递推公式。。。于是 f(1,n)=1+nf(2,n)=1+n+n*(n-1)/2f(3,n)=1+n+n*(n-1)/2+n*(n-1)*(n-2)/6 = (... 阅读全文
posted @ 2015-12-30 19:33 chenhuan001 阅读(177) 评论(0) 推荐(0) 编辑
摘要:精度比acos , asin 什么的高些。ParametersyValue representing the proportion of the y-coordinate.xValue representing the proportion of the x-coordinate.If both a... 阅读全文
posted @ 2015-12-30 00:53 chenhuan001 阅读(469) 评论(0) 推荐(0) 编辑
摘要:计算几何头疼的地方一般在于代码量大和精度问题,代码量问题只要平时注意积累模板一般就不成问题了。精度问题则不好说,有时候一个精度问题就可能成为一道题的瓶颈,简直“画龙点睛”。这些年的题目基本是朝着越来越不卡精度的方向发展了,但是也不乏一些%^&%题#$%$^,另外有些常识不管题目卡不卡,都是应该知道的... 阅读全文
posted @ 2015-12-30 00:17 chenhuan001 阅读(522) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #define MAX_N 100using namespace std; /////////////////////////////////////////////////////////////////////常量区c... 阅读全文
posted @ 2015-12-29 17:02 chenhuan001 阅读(294) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示