pku2276Model Rocket Height
//
// File: pku2276Model Rocket Height.cc
// Author: Administrator
//
// Created on 2009年6月14日, 下午8:12
//
#include <stdlib.h>
#include<stdio.h>
#include<math.h>
//three observers A,B and C equally spaced D feet apart along a line
//at one edge of the flat test field
// γ (the angle above the horizontal in degrees measured by the rightmost observer C)
//finally add H
//在比地面高H的是平面形成一个带中线的三角形
//根据平行四边形定理 四条边平方和等于 对角线平方和推出公式
#define pi 3.141592654
int main(int argc, char** argv) {
double D,H,a,b,c,a2,b2,c2,a1,b1,c1,deno,mole,h;
scanf("%lf%lf",&D,&H);
while(1){
scanf("%lf%lf%lf",&a,&b,&c);
if(a<=0||b<=0||c<=0)break;
a=a*pi/180;
b=b*pi/180;
c=c*pi/180;
a1=tan(a);
b1=tan(b);
c1=tan(c);
a2=tan(a)*tan(a);
b2=tan(b)*tan(b);
c2=tan(c)*tan(c);
mole=sqrt((double)2.0)*D*a1*b1*c1;
deno=sqrt((double)(c2*(b2-a2)+a2*(b2-c2)));
h=mole/deno;
printf("%.0lf/n",h+H);
}
return (EXIT_SUCCESS);
}
/*Sample Input
50 4
43.88 46.85 40.70
34.52 39.50 35.43
27.05 29.22 26.14
0 0 0
Sample Output
90
70
60
*/