/* poj 3130 How I Mathematician Wonder What You Are! - 求多边形有没有核 */ #include <stdio.h> #include<math.h> const double eps=1e-8; const int N=103; struct point { double x,y; }dian[N]; inline bool mo_ee(double x,double y) { double ret=x-y; if(ret&l…
题目链接:POJ 3130 Problem Description After counting so many stars in the sky in his childhood, Isaac, now an astronomer and a mathematician uses a big astronomical telescope and lets his image processing program count stars. The hardest part of the prog…
题意:逆时针给出N个点,求这个多边形是否有核. 思路:半平面交求多边形是否有核.模板题. 定义: 多边形核:多边形的核可以只是一个点,一条直线,但大多数情况下是一个区域(如果是一个区域则必为 ).核内的点与多边形所有顶点的连线均在多边形内部. 半平面交:对于平面,任何直线都能将平面划分成两部分,即两个半平面.半平面交既是多个半平面的交集.定义如其名. 半平面交求多边形的核. 设多边形点集为 *p,核的点集为*cp. 开始时将p的所有点放到cp内,然后枚举多边形的所有边去切割cp,cp中在边内侧的…
/* poj 1474 Video Surveillance - 求多边形有没有核 */ #include <stdio.h> #include<math.h> const double eps=1e-8; const int N=103; struct point { double x,y; }dian[N]; inline bool mo_ee(double x,double y) { double ret=x-y; if(ret<0) ret=-ret; if(ret&…
http://poj.org/problem?id=3130 #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define maxn 1000000 using namespace std; ); struct point { double x,y; }; double a,b,c; ,m; point p1[maxn]; point p2[maxn];…
Description After counting so many stars in the sky in his childhood, Isaac, now an astronomer and a mathematician uses a big astronomical telescope and lets his image processing program count stars. The hardest part of the program is to judge if shi…
题目链接 题意 : 给你一个多边形,问你该多边形中是否存在一个点使得该点与该多边形任意一点的连线都在多边形之内. 思路 : 与3335一样,不过要注意方向变化一下. #include <stdio.h> #include <string.h> #include <iostream> #include <math.h> using namespace std ; struct node { double x; double y ; } p[],temp[],n…
求多边形的核,直接把所有边求半平面交判断有无即可 #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; const int N=205; const double eps=1e-6; int n; struct dian { double x,y; dian(double X=0,double Y=0) { x=X,y=Y; }…
<题目链接> 题目大意: 按顺时针顺序给出一个N边形,求N边形的核的面积. (多边形的核:它是平面简单多边形的核是该多边形内部的一个点集该点集中任意一点与多边形边界上一点的连线都处于这个多边形内部.) #include <cstdio> #include <cmath> #include <iostream> using namespace std; #define eps 1e-8 ; int n; double r; int cCnt,curCnt; s…
求半平面交的算法是zzy大神的排序增量法. ///Poj 1474 #include <cmath> #include <algorithm> #include <cstdio> using namespace std; ; //点 class Point { public: double x, y; Point(){} Point(double x, double y):x(x),y(y){} bool operator < (const Point &…