计算几何
文章平均质量分 80
dd_lucky
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #346 (Div. 2) D. Bicycle Race
D. Bicycle Racetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMaria participates in a bicycle race.The原创 2016-04-01 19:49:02 · 254 阅读 · 0 评论 -
uva 12818 Arc and Point && csu1503: 点到圆弧的距离
此题先求出圆心,然后判断p点是否与b点在同一边,只要考虑两种情况就行了#include#include#includeusing namespace std;struct point{double x,y;point(){}point(double _x,double _y){x=_x;y=_y;}}a,b,c,p;point wx(原创 2016-03-30 21:52:16 · 410 阅读 · 0 评论 -
hdu5858 Hard problem
Hard problem题目链接:点击打开链接题意:求正方形里的一个阴影面积ps:这是一道小学竞赛题思路:我们先求出就ACE和AOE的角度出来然后根据角度求出两个扇形的面积,三角形CAO面积用海伦公式代码如下:#includeusing namespace std;const double pi=3.14159265358979323846;原创 2016-08-19 13:45:00 · 535 阅读 · 0 评论 -
Educational Codeforces Round 2 D. Area of Two Circles' Intersection
D. Area of Two Circles' Intersection题目链接:点击打开链接题意:求两个圆的相交面积;思路: 大家都知道两圆的位置关系有五种:①两圆外离 d>R+r ②两圆外切 d=R+r ③两圆相交 R-r<d<R+r(R>r) ④两圆内切 d=R-r(R>r) ⑤两圆内含d<R-r(R>r)按着分类来做即可 我把外切和外离,内切和内含放原创 2016-09-09 18:04:46 · 270 阅读 · 0 评论 -
2016 Multi-University Training Contest 2 Eureka
Problem DescriptionProfessor Zhang draws n points on the plane, which are conveniently labeled by 1,2,...,n. The i-th point is at (xi,yi). Professor Zhang wants to know the number of best原创 2016-07-22 17:12:00 · 269 阅读 · 0 评论 -
求关于一条直线的对称点
已知直线l:a*x+b*y+c=0(a!=0,b!=0)点A(x1,y1),求点关于直线l的对称点A'.可以设A'为(x,y),那么可知点((x1+x)/2, (y1+y)/2) )在直线l上,且过点A与点A'的直线与l垂直,及斜率的乘积为-1,可以得到计算公式a*(x+x1)/2+b*(y+y1)/2+c=0 .....公式1a*(y-y1)/(b*(x-x1))=1....公式2原创 2016-04-12 21:53:00 · 4329 阅读 · 2 评论 -
poj 1410 Intersection
You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) end point: (11,2) rectangle: left-top: (1,5) r原创 2016-04-12 21:14:32 · 379 阅读 · 0 评论 -
poj 1066 Treasure Hunt
Archeologists from the Antiquities and Curios Museum (ACM) have flown to Egypt to examine the great pyramid of Key-Ops. Using state-of-the-art technology they are able to determine that the lower floo原创 2016-04-12 21:09:27 · 252 阅读 · 0 评论 -
poj 2653 Pick-up sticks
Stan 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 there is no原创 2016-04-12 21:05:04 · 261 阅读 · 0 评论 -
poj 1269 Intersecting Lines
We 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 parallel, 2) intersect原创 2016-04-12 21:02:33 · 351 阅读 · 0 评论 -
poj3304 Segments
Given 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 least one point原创 2016-04-12 20:53:04 · 231 阅读 · 0 评论 -
poj 2398 Toy Storage
Mom 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 rebellious an原创 2016-04-12 20:47:38 · 197 阅读 · 0 评论 -
poj2318 TOYS
Calculate the number of toys that land in each bin of a partitioned toy box.Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave Jo原创 2016-04-12 20:41:49 · 257 阅读 · 0 评论 -
vtk 二维爱心的制作
本文是用vtk来实现的,首先通过公式计算出二维爱心的点,然后利用vtkParametricSpline类来将点连接起来,最后通过建立二维三角剖分然后再加了一些约束就完成啦,效果如下:实现代码如下#include <vtkPolyData.h>#include <vtkSmartPointer.h>#include <vtkPolyDataMapp...原创 2019-07-25 18:50:28 · 623 阅读 · 0 评论