Uva 375 Inscribed Circles and Isosceles Triangles
来源:互联网 发布:超级淘宝店主系统小说 编辑:程序博客网 时间:2024/05/17 03:42
Inscribed Circles and Isosceles Triangles
Given two real numbers
- B
- the width of the base of an isosceles triangle in inches
- H
- the altitude of the same isosceles triangle in inches
Compute to six significant decimal places
- C
- the sum of the circumferences of a series of inscribed circles stacked one on top of another from the base to the peak; such that the lowest inscribed circle is tangent to the base and the two sides and the next higher inscribed circle is tangent to the lowest inscribed circle and the two sides, etc. In order to keep the time required to compute the result within reasonable bounds, you may limit the radius of the smallest inscribed circle in the stack to a single precision floating point value of 0.000001.
For those whose geometry and trigonometry are a bit rusty, the center of an inscribed circle is at the point of intersection of the three angular bisectors.
Input
The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs.
The input will be a single line of text containing two positive single precision real numbers (BH) separated by spaces.
Output
For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line.
The output should be a single real number with twelve significant digits, six of which follow the decimal point. The decimal point must be printed in column 7.
Sample Input
10.263451 0.263451
Sample Output
0.827648
题目大意:
给你一个等腰三角形的底和高,叫你算出等腰三角形的所有的内切圆的周长的和,精确到小数点后6位。
注意:为了保证PI的精确,PI = arccos(-1)
#include <stdio.h>#include <math.h>const double PI = acos(-1.0);int main() {int t;while(scanf("%d",&t) != EOF) {while(t--) {double b,h;double a,r,sum;sum=a=r=0;scanf("%lf%lf",&b,&h);while(1) {a = atan(h/(b/2));r = ( b*tan(a/2) )/2;if(r < 1e-6)break;sum += 2*PI*r;b = b*(h - 2*r)/h;h = h - 2*r;}printf("%13.6lf\n",sum);if(t != 0)printf("\n");}}return 0;}
- uva 375 - Inscribed Circles and Isosceles Triangles
- UVA 375 - Inscribed Circles and Isosceles Triangles
- Uva 375 - Inscribed Circles and Isosceles Triangles
- uva 375 - Inscribed Circles and Isosceles Triangles
- UVA 375 Inscribed Circles and Isosceles Triangles
- UVA 375Inscribed Circles and Isosceles Triangles
- uva 375 Inscribed Circles and Isosceles Triangles
- UVa 375 - Inscribed Circles and Isosceles Triangles
- UVa - 375 - Inscribed Circles and Isosceles Triangles
- UVa 375 - Inscribed Circles and Isosceles Triangles
- Uva 375 Inscribed Circles and Isosceles Triangles
- UVA - 375 Inscribed Circles and Isosceles Triangles
- UVa 375 Inscribed Circles and Isosceles Triangles
- UVA - 375 Inscribed Circles and Isosceles Triangles
- UVA - 375 Inscribed Circles and Isosceles Triangles
- UVA 375 Inscribed Circles and Isosceles Triangles
- UVA - 375 Inscribed Circles and Isosceles Triangles
- UVA - 375 Inscribed Circles and Isosceles Triangles
- java JDK源码中的Iterator
- hdu 3308(区间和并)
- 给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字
- ASP.NET的内置对象:Response对象
- poj Command Network 最小树形图
- Uva 375 Inscribed Circles and Isosceles Triangles
- 一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同
- Flex DateFormatter组件如何解析GMT+8:00
- 在iOS工程中如何选择最佳的XML解析器
- spring用到的设计模式
- hdu 1408 盐水的故事
- 选择排序算法
- POJ 2236 Wireless Network 并查集
- 请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母。