编程介的小学生 2017-08-05 09:22 采纳率: 20.5%
浏览 820
已采纳

Collision Ball Game

Collision ball game is one of my favorite game when I was young. I was so fond of this game that I nearly decided to be a physical scientist (But I am not now). Firstly I wanted to construct a problem to describe the whole process of this game. But it is too difficult for me and I hate being bsed by others for wrong data.

So I decide to make it easier, but maybe I will construct one next time.

Assume the game is in a triangle with the lower-right angle k (in degree) and height h. (see the picture)

The ball's initial place is in (0, a) and it eventually arrives at (b, 0) with collising the bevel edge only once. The two points (0, a) and (b, 0) will always be on the edge of the triangle.

You are to calculate the distance the ball pass. The process of collision obey the physical law. The angle of incidence equals to the angle of reflection.

Input

The input contains multiple test cases. Each test cases contain four number (all double). The first line is the angle of the triangle k (in degree, 0 < k < 90). The second line is the height h (h > 0). The third line is a. The fourth line is b (a, b >= 0).

Process to the end-of-file.

Output

For each test case print a single line that contains the distance the ball pass (rounded to 2 decimal places).

Sample Input

45
2
1
1

30
2
1
2.3094
Sample Output

2.00
2.89

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-08-07 15:26
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 matlab有限元法求解梁带有若干弹簧质量系统的固有频率
  • ¥15 找一个网络防御专家,外包的
  • ¥100 能不能让两张不同的图片md5值一样,(有尝)
  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码
  • ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
  • ¥20 MATLAB绘制两隐函数曲面的交线
  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流
  • ¥15 高价求中通快递查询接口