poj 1701【数学几何】
2013-11-04 22:55
302 查看
The area
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6524 Accepted Submission(s): 4578
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1071
[align=left]Problem Description[/align]
Ignatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the intersectant points shows in the picture, can you tell Ignatius the area of the land?
Note: The point P1 in the picture is the vertex of the parabola.
#include<iostream> #include<string.h> #include<stdio.h> using namespace std; int main() { int zong; cin>>zong; while(zong--) { double x1,y1,x2,y2,x3,y3; cin>>x1>>y1>>x2>>y2>>x3>>y3; double t1=(x2*x2-x3*x3)*(y2-y1)-(x2*x2-x1*x1)*(y2-y3); double t2=(x2*x2-x3*x3)*(x2-x1)-(x2*x2-x1*x1)*(x2-x3); double b=t1/t2; double a=(y2-y1-b*(x2-x1))/(x2*x2-x1*x1); double c=y1-a*x1*x1-b*x1; double k=(y2-y3)/(x2-x3); double d=y2-k*x2; double s1=1.0/3.0*a*(x3*x3*x3-x2*x2*x2)+1.0/2*b*(x3*x3-x2*x2)+c*(x3-x2); double s2=(k*(x2+x3)+2*d)*(x3-x2)*1.0/2.0; double s=s1-s2; printf("%.2lf\n",s); } return 0; }
View Code
[align=left] [/align]
相关文章推荐
- POJ 题目1905 Expanding Rods(二分,数学几何)
- hdoj 1454&&poj 1039 Pipe 1454 (数学计算几何) 枚举
- 【阔别许久的博】【我要开始攻数学和几何啦】【高精度取模+同余模定理,*】POJ 2365 The Embarrassed Cryptographer
- POJ:2507 Crossed ladders(二分+几何数学)
- POJ 题目1106 Transmitters(数学几何)
- poj--2007--Scrambled Polygon(数学几何基础)
- poj--2007--Scrambled Polygon(数学几何基础)
- POJ 题目3305Surveillance(数学几何,三分)
- POJ 1905 Expanding Rods(几何+二分)
- poj 3244 Difference between Triplets——数学
- Cg(C for Graphic)语言标准函数库之数学函数与几何函数!
- POJ 1066 Treasure Hunt --几何,线段相交
- POJ 3100 & ZOJ 2818 & HDU 2740 Root of the Problem(数学)
- POJ 3299(湿润指数 简单数学) 解题报告
- POJ-1850-Code-组合数学
- poj 1927 计算几何 解题报告
- poj 2826 An Easy Problem?!(计算几何)
- 【POJ】2318 TOYS ——计算几何+二分
- 简单几何(线段相交) POJ 1410 Intersection
- poj 1183 数学推导(反正切函数的应用)