uva 10209 Is This Integration ? (计算几何)
2014-07-29 13:14
357 查看
Problem C
Is This Integration ?
Input: Standard Input
Output: Standard Output
Time Limit: 3 seconds
In the image below you can see a square ABCD, where AB = BC = CD = DA = a. Four arcs are drawn taking the four vertexes A, B, C, Das centers and a as the radius. The arc that is drawn taking A as
center, starts at neighboring vertex B and ends at neighboring vertex D. All other arcs are drawn in a similar fashion. Regions of three different shapes are created in this fashion. You will have to determine the total area
if these different shaped regions.
Input
The input file contains a floating-point number a (a>=0 a<=10000) in each line which indicates the length of one side of the square. Input is terminated by end of file.
Output
For each line of input, output in a single line the total area of the three types of region (filled with different patterns in the image above). These three numbers will of course be floating point numbers with three digits after the decimal point. First
number will denote the area of the striped region, the second number will denote the total area of the dotted regions and the third number will denote the area of the rest of the regions.
Sample Input:
0.1
0.2
0.3
Sample Output:
0.003 0.005 0.002
0.013 0.020 0.007
0.028 0.046 0.016
Shahriar Manzoor
题目大意:
告诉你正方形的面积,求不同颜色的阴影部分的面积。
解题思路:
设各块面积为x,y,z,建立三个方程即可求解。
解题代码:
Is This Integration ?
Input: Standard Input
Output: Standard Output
Time Limit: 3 seconds
In the image below you can see a square ABCD, where AB = BC = CD = DA = a. Four arcs are drawn taking the four vertexes A, B, C, Das centers and a as the radius. The arc that is drawn taking A as
center, starts at neighboring vertex B and ends at neighboring vertex D. All other arcs are drawn in a similar fashion. Regions of three different shapes are created in this fashion. You will have to determine the total area
if these different shaped regions.
Input
The input file contains a floating-point number a (a>=0 a<=10000) in each line which indicates the length of one side of the square. Input is terminated by end of file.
Output
For each line of input, output in a single line the total area of the three types of region (filled with different patterns in the image above). These three numbers will of course be floating point numbers with three digits after the decimal point. First
number will denote the area of the striped region, the second number will denote the total area of the dotted regions and the third number will denote the area of the rest of the regions.
Sample Input:
0.1
0.2
0.3
Sample Output:
0.003 0.005 0.002
0.013 0.020 0.007
0.028 0.046 0.016
Shahriar Manzoor
题目大意:
告诉你正方形的面积,求不同颜色的阴影部分的面积。
解题思路:
设各块面积为x,y,z,建立三个方程即可求解。
解题代码:
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const double pi=acos(-1); int main(){ double a; while(cin>>a){ double z=a*a-pi*a*a/6.0-sqrt(3)/4.0*a*a; double y=a*a-pi*a*a/4.0-2.0*z; double x=a*a-4.0*y-4.0*z; printf("%.3lf %.3lf %.3lf\n",x,4*y,4*z); } return 0; }
相关文章推荐
- UVa 10209 Is This Integration ?(计算几何)
- uva 10209 Is This Integration ? (计算几何)
- UVa 10209 - Is This Integration ?
- UVA 10209 - Is This Integration
- UVA 10209(Is This Integration ?-容斥原理)
- UVa 10209 - Is This Integration ?
- UVa 10012 How Big is It? (计算几何+DFS)
- UVa Problem 10209 Is This Integration? (需要积分吗?)
- UVALive - 3263 - That Nice Euler Circuit (计算几何~~)
- UVA 1331 Minimax Triangulation [最优三角剖分] [dp] [计算几何]
- uva 1531 & poj 1518 Problem Bee(几何计算+贪心)
- UVA 10652 Board Wrapping(计算几何基础,求凸包)
- UVA 11930 - Rectangles(2-sat + 计算几何)
- UVA 11178 Morley’s Theorem(计算几何直线的交点)
- uva 10173 Smallest Bounding Rectangle (计算几何-凸包)
- UVALive 4428 Solar Eclipse --计算几何,圆相交
- UVA-11178 - Morley's Theorem(计算几何)
- UVA 1473 - Dome of Circus(三分+计算几何)
- UVA 10347 - Medians(计算几何)
- uva 10652 Board Wrapping (计算几何-凸包)