
计算几何
文章平均质量分 56
不可不戒
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu1086 You can Solve a Geometry Problem too
#include //(abXac)(abXad)<0 && (cdXca)(cdXcb)<0struct segment{ double x1,y1,x2,y2;}seg[102];int Judge(int i,int j){ double a,b,c,d,x,y,a1,b1; a=seg[i].x1-seg[j].x1; b=seg[i].y1-seg[j].y1;原创 2013-07-11 18:37:43 · 752 阅读 · 0 评论 -
xmu 1423.整点坐标
#include #include //求n和m的最大公约数,那么这个公约数+1即为问题的解(为什么要加一呢?因为要算上原点,平移)int gcd(int a,int b){ if(b==0) return a; else return gcd(b,a%b);}int OnSegment(int x1,int y1,int x2,int y2){ return g原创 2013-05-03 21:35:33 · 901 阅读 · 0 评论 -
hdu2108 Shape of HDU
//公式:s=(x1-x3)*(y2-y3)-(x2-x3)*(y1-y3) //当s>0时,p1,p2,p3三个点呈逆时针 //当s<0时,p1,p2,p3三个点呈顺时针#include struct point{ int x,y;}p[1002];int get(int a,int b,int c){ int s; s=(p[a].x-p[c].x)*(p[b].原创 2013-07-15 21:56:21 · 1166 阅读 · 0 评论 -
hdu1558 Segment set
#include#include #define MAXN 1005int father[MAXN],num[MAXN];typedef struct node{ double x,y;}point;struct edge{ point p1; point p2;} seg[MAXN];double Max(double x,double y){ return原创 2013-07-15 19:25:51 · 695 阅读 · 0 评论 -
计算几何-多边形的重心
1. 1 累加和求重心设平面上有N 个离散数据点( xi , yi ) ( i = 1, 2, ., n) , 其多边形重心G( . x1, . y1) 为: 这是求多边形最简单直观的方法。可以直接利用离散数据点的x, y坐标就能求图形重心。但是缺陷在于没有对离散数据点所围图形做任何处理和分析,精度不够。1. 2 算法一:在讲该算法时,先要明白下面几个转载 2013-08-10 14:34:51 · 933 阅读 · 0 评论 -
hdu1115 Lifting the Stone (多边形重心)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1115模版题#include #include typedef struct node{ double x,y;}point;double Area(point p0,point p1,point p2){ double area=0; area=p0.x*p1.y原创 2013-08-10 15:06:27 · 674 阅读 · 0 评论 -
hdu2289 Cup
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2289#include #include #define EPS 1e-8const double PI=3.14159265;double r,R,H,V;double Cal(double x){ double r0=(R-r)*x/H+r; return PI*x*原创 2013-09-07 10:10:48 · 714 阅读 · 0 评论