这道题得控制好精度,不然会贡献WA  QAQ 还是那个规则: int sgn(double x){ if(x > eps) return 1; else if(x < - eps) return -1; else return 0; } 思路:把简单多边形的每一个点和原点连线,就把这个多边形和圆的交变成了多个三角形与圆的交,根据有向面积的思路,加加减减就可以得到公共面积. 贴上代码了- #include <cstdio> #include <cstring> #incl…
Description Updog is watching a plane object with a telescope. The field of vision in the telescope can be described as a circle. The center is at the origin and the radius is R. The object can be seen as a simple polygon of N vertexes. Updog wants t…
题意:给定一个不自交的多边形,要求和圆心在原点的圆的面积交. 思路:同POJ2986,是加强版 代码: #include<algorithm> #include<cstdio> #include<cmath> #include<cstring> #include<iostream> struct Point{ double x,y; Point(){} Point(double x0,double y0):x(x0),y(y0){} }p[],a…
3675 -- Telescope 再来一题.这题的代码还是继续完全不看模板重写的. 题意不解释了,反正就是一个单纯的圆与多边形的交面积. 这题的精度有点搞笑.我用比较高的精度来统计面积,居然wa了.把精度降到1e-6瞬间过了. ——written by Lyon…
题意:给出多边形的顶点坐标.圆的圆心坐标和半径,求面积交 sol:又是模板题啦= = 注意poj的C++好像认不出hypot函数,要稍微改写一下. hypot(double x,double y):即返回sqrt(x*x+y*y)的值 #include<vector> #include<list> #include<map> #include<set> #include<deque> #include<queue> #include&…
Intersection Time Limit: 4000/4000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others) Problem Description Matt is a big fan of logo design. Recently he falls in love with logo made up by rings. The following figures are some famous examp…
题意:给定两个圆环,求两个圆环的面积交. 析:很容易知道,圆环面积交就是,大圆与大圆面积交 - 大圆和小圆面积交 - 小圆和大圆面积交 + 小圆和小圆面积交. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #includ…
pro:飞行员去轰炸一个小岛,给出炸弹落地点的位置信息,以及轰炸半径:按顺时针或者逆时针给出小岛的边界点. 求被轰炸的小岛面积. sol:即是求圆和多边形的面积交. (只会套板子的我改头换面,先理解然后手打一遍. 首先,我们还是用三角剖分多边形,求“有向面积”,有向面积可以避免凹多边形存在的情况,或者二者相离的情况. 我们把圆心设为起点,然后对于一个三角形,求它和圆的面积交. 此时有4中情况. 1,三角形在圆的内部.    即OA ,OB的出度都不大于r. 2,一个点在圆外,一个点在圆内. 那么…
Harry Potter and J.K.Rowling http://acm.hdu.edu.cn/showproblem.php?pid=3982 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1094    Accepted Submission(s): 357 Problem Description In July 31st,…
Circular Area Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5682   Accepted: 2225 Description Your task is to write a program, which, given two circles, calculates the area of their intersection with the accuracy of three digits after…