UVa 10209 Is This Integration ?(计算几何)
来源:互联网 发布:手机淘宝下载安装 编辑:程序博客网 时间:2024/06/06 13:03
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, D as 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.10.2
0.3
Sample Output:
0.003 0.005 0.0020.013 0.020 0.007
0.028 0.046 0.016
#include <iostream>#include <iomanip>#include <cmath>using namespace std;const double PI = acos(-1.0);double a, A, B, C;int main() { ios::sync_with_stdio(false); while (cin >> a) { A = (1.0 - sqrt(3) + PI / 3.0) * a*a; B = (-4.0 + 2.0*sqrt(3) + PI / 3.0) * a*a; C = (4.0 - sqrt(3) - 2.0 / 3.0 * PI) * a*a; cout << fixed << setprecision(3) << A << " " << B << " " << C << endl; } 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 10209 - Is This Integration ?
- UVa Problem 10209 Is This Integration? (需要积分吗?)
- UVA 10209(Is This Integration ?-容斥原理)
- uva 190(计算几何)
- UVa 10012 How Big is It? (计算几何+DFS)
- UVA Orchard Trees(计算几何)
- uva 10668(计算几何+二分)
- uva 11524 InCircle 内切圆(计算几何)
- UVA - 11796 - Dog Distance (计算几何~)
- UVA - 11437 - Triangle Fun (计算几何~)
- UVA - 11646 - Athletics Track (计算几何~)
- uva 11178 计算几何
- 标准开源产品是破除锁定陷阱的关键
- 初级软件开发人员进修必备的20本书(上)
- 反正切函数的应用
- Pots——BFS
- POJ 2409 Let it Bead(Polya简单应用)
- UVa 10209 Is This Integration ?(计算几何)
- hdu1754
- Metasploit2 - tcp port 21 - vsftpd
- Android 系统的java世界是怎么诞生的?孵化器zygote的初步探索
- 支付宝异步通知 asp
- Hiberante 4.5.1 配置遇到的困难
- 数据结构中链表元素的删除
- 大端小端格式详解
- 452A - Eevee 模拟字符串,挺简单的一道题