计算几何
文章平均质量分 94
断弦
这个作者很懒,什么都没留下…
展开
-
求三角形的外接圆圆心个半径
做华南师范大学校赛初赛的一道计算几何题,无聊暴力推公式。#include#include#includeusing namespace std;int main(){ double x1,y1,x2,y2,x3,y3,x0,y0,r; while(~scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)) { x0=((y3原创 2012-05-21 19:41:59 · 2410 阅读 · 0 评论 -
HDU 2440、HDU 3694多边形费马点
费马点是指求到N个点距离和最小的点。通常要求的是简单多边形的费马点。1、http://acm.hdu.edu.cn/showproblem.php?pid=2440 按照题意知道是一个简单的多边形即凸包,但给出的点并没有按照顺序的,所以需要自己先求出凸包,然后在用随机淬火求费马点。#include#include#include#include#include#include原创 2012-10-12 16:24:56 · 3540 阅读 · 0 评论 -
旋转卡壳解决一类问题(程序)——未完待续
1、旋转卡壳求凸多边形直径(即求平面点集最远点对)http://poj.org/problem?id=2187 本题数据较水,可以直接暴力#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace原创 2012-10-10 21:23:10 · 671 阅读 · 0 评论 -
旋转卡壳解决一类问题(资料)
以下所有文章均转载( http://blog.csdn.net/acmaker/article/details/3176910) 转载请注明出处!1、旋转卡壳——翻译说明文档 前一段时间看了一位国外大牛的网站,是关于旋转卡壳技术的,内容很不错,就尝试着翻译一下。 关于旋转卡壳技术,最早是在刘汝佳、黄亮的《算法艺术与信息学竞赛》上看到的,是计算几何相关的技术,开始觉得很转载 2012-10-10 21:10:17 · 2287 阅读 · 0 评论 -
一类凸包题目(未完)
注:《黑书》P392中有讲:对于通常求的凸包,输出的凸包是包括所有可能的共线点还是不包括任何共线点(即只有极点)这是取决于题目的题目要求的。在下面的程序中都会将去共线点的代码加上,视题目删除。1、http://poj.org/problem?id=1113 简单凸包,求凸包的周长和圆周Graham-Scan 算法#include#include#include#i原创 2012-10-08 20:17:27 · 774 阅读 · 0 评论 -
2012 Multi-University Training Contest 9__Farmer Greedy和Quadrilateral
Problem Description Farmer Greedy is going to buy some houses for his farm. He has money only to buy three houses. The three houses can from a triangle area, which he can own as his farm. Ther原创 2012-08-22 20:43:23 · 708 阅读 · 0 评论 -
SPOJ AMR11B:Save the Students_判断点是否在圆、矩形、三角形内
Hogwarts is under attack by the Dark Lord, He-Who-Must-Not-Be-Named. To protect the students, Harry Potter must cast protective spells so that those who are protected by the spells cannot be attacked原创 2012-07-10 21:58:50 · 1193 阅读 · 0 评论 -
POJ 2398:Toy Storage _叉积性质
DescriptionMom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is原创 2012-08-20 19:20:09 · 624 阅读 · 0 评论 -
POJ 1584:A Round Peg in a Ground Hole _判断点是否在多边形内(5种方法)
DescriptionThe DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to one another using a wooden peg that fits into pre-cut holes in原创 2012-08-07 09:51:19 · 1644 阅读 · 1 评论 -
UVa 634 - Polygon:判断点在任意多边形内
Modern graphic computer programs can, among other, even more stunning capabilities, fill a closed region. Though not all of them can protect the user from accidentally choosing to fill the background原创 2012-08-08 10:40:42 · 799 阅读 · 0 评论 -
POJ 2653:Pick-up sticks _判断两线段是否相交
DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that原创 2012-08-06 18:38:06 · 652 阅读 · 0 评论 -
POJ - 1269:Intersecting Lines__判断两直线相交
DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are paral原创 2012-08-06 15:19:07 · 776 阅读 · 0 评论 -
ZOJ 1648:Circuit Board __判断两线段相交
On the circuit board, there are lots of circuit paths. We know the basic constrain is that no two path cross each other, for otherwise the board will be burned.Now given a circuit diagram, your ta原创 2012-08-06 14:05:12 · 574 阅读 · 0 评论 -
POJ - 3304 :Segments__判断直线和线段是否 相交
DescriptionGiven n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at原创 2012-08-06 16:56:08 · 589 阅读 · 0 评论 -
ACM计算几何推荐
转自http://hi.baidu.com/novosbirsk/blog/item/723a9727a9ab8804918f9dca.html其实也谈不上推荐,只是自己做过的题目而已,甚至有的题目尚未AC,让在挣扎中。之所以推荐计算几何题,是因为,本人感觉ACM各种算法中计算几何算是比较实际的算法,在很多领域有着重要的用途(例如本人的专业,GIS)。以后若有机会,我会补充、完善这个列转载 2012-08-06 14:32:07 · 2125 阅读 · 0 评论 -
UVA - 12475 :求椭圆的周长,精度要求很高
暑期电大组队训练赛的一题。 题意是给出椭圆的长半轴a和b,求椭圆的周长,精度要求很高! 关于椭圆周长(L)的精确计算要用到积分或无穷级数的求和.//显然直接利用积分计算太困难,而利用被转化过来的级数计算则显然方便的多。只是循环到多大级数才算最好。我参照一篇论文(但依据论文写的程序很多小数据并不能过)提供的数据 公式(8)C值 椭圆周长真值 误差率原创 2012-07-17 19:12:44 · 1255 阅读 · 0 评论 -
2011 Asia Beijing Regional B:Hou Yi's secret
Long long ago, in the time of Chinese emperor Yao, ten suns rose into the sky. They burned the crops and scorched the bushes and trees, leaving the people with nothing to eat.Hou Yi was the grea原创 2012-10-18 20:16:55 · 1788 阅读 · 0 评论