编程介的小学生 2016-12-24 15:36 采纳率: 20.5%
浏览 910
已采纳

Model Rocket Height

Description

One method used to determine the height achieved by a model rocket is the geodesic method. Two observers A and B are spaced 100 feet apart along a base line along one edge of the flat test field. The launch platform is equidistant from observers A and B and 50 feet from the base line. Each observer has a theodolite or some other device for measuring angle above the horizontal (elevation angle) of a distant object and the azimuth angle (the angle the vertical plane of the sight line makes with the line from A through B measured counter-clockwise). Each measuring device is on a stand. A’s device is HA feet above the launch platform and B’s device is HB feet above the launch platform. When a rocket is fired, near the top of its flight, it deploys a parachute and emits a puff of smoke. Each observer measures the elevation angle and azimuth angle of the puff of smoke from their location. If the peak location is on the wrong side of the baseline or outside the lines determined by A and B perpendicular to the base line, it is out of bounds and disqualified. From this information, the height of the rocket may be determined as follows:

On each sight line, find the point on that sight line closest to the other sight line. The point halfway between these two points is assumed to be the location of the rocket at the top of its flight. The height achieved by the rocket is the vertical distance of this point above the launch platform.

This problem is to write a program which, given the parameters HA (the distance of the measuring device A above the launch platform in feet), HB (the distance of the measuring device B above the launch platform in feet), α (the elevation angle of the rocket in degrees measured by the left observer A), β (the elevation angle of the rocket in degrees observed by the right observer B), γ (the azimuth angle in degrees measured by the left observer A) and δ (the azimuth angle in degrees measured by the right observer B), computes the height of the rocket above the launch platform in feet to the nearest foot.

Input

The first line of input contains the number of shots that follow N (1 ≤ N ≤= 100) and the parameters HA and HB in that order as decimal values (the values are separated by one or more spaces). These values would be measured once at the beginning of the day and remain fixed through all N rocket shots. Each succeeding line of input will contain the angles α, β, γ and δ in that order (measured in degrees) as decimal values. The angles α, β and γ will be strictly between 0 and 90 degrees and δ will be strictly between 90 degrees and 180 degrees.

Output

For each set of four angles (other than the end indicator), the output contains a line with the shot number, (1...N), a colon, a space and finally the height above the field in feet to the nearest foot with no leading spaces.

Sample Input

4 5.25 2.92
39.6 36.0 35.4 151.2
65.1 71.2 16.5 160.6
59.4 59.5 43.8 139.0
45.0 41.2 32.9 152.6
Sample Output

1: 50
2: 135
3: 119
4: 58

  • 写回答

1条回答 默认 最新

  • devmiao 2016-12-24 16:28
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格