编程介的小学生 2017-07-21 11:55 采纳率: 20.5%
浏览 963
已采纳

Eclipse

Problem Description
As you know, when the moon goes between you and the sun, it may block your sight, and thus you can only see part of the sun, or even cannot see it at all. This is called eclipse.
Now the news says that an eclipse will take place in several days. Being interested in astronomy, YY is curious whether he can observe the eclipse in the city he lives in, or he has to go somewhere else. Without loss of generality, YY models the problem as follows:
1.There is one and only one light source, called ‘the sun’, in a 3-dimensional space. It is sphere shaped, centered at the origin (0, 0, 0), with radius R.
2.There is one and only one obstacle, called ‘the moon’, in the same 3D space. It is also sphere shaped, center at the point (x0, y0, z0), with radius r. Besides, it is completely opaque.
3.There is one and only one observer, called ‘YY’, in the same 3D space, too. He is not sphere shaped. Comparing to the moon and the sun, his volume is so small that he can be regarded as a point located at (x1, y1, z1).
4.There is nothing and nobody else in the space.
5.There is no assumption which of the two spheres is bigger.
6.The sun and the moon neither intersect with each other, nor even touch. And for his safety and comfort, YY will not be inside or on the surface of any of the spheres.
Four situations may occur:
1.Total eclipse: the sun is totally blocked by the moon, so no part of the sun can be seen by YY.
2.Partial eclipse: part of the sun is blocked, and part can be seen. To be distinguished from annular eclipse, part of the border of the sun must be blocked in a partial eclipse.
3.Annular eclipse: some central part of the sun is blocked and cannot be seen by YY, but the whole border of the sun must be visible.
4.No eclipse at all: The whole sun is observable, so YY cannot observe any eclipse at all.

Input
Input contains multiple test cases.

For each test case, there is only one single line consisting of 8 integers with absolute value no larger than 1000: R, r, x0, y0, z0, x1, y1, z1, indicating the radii of the sun and the moon, the location of the moon, and the location of YY. R and r are always positive.

A line with 8 space-separated 0s indicates the end of input.

Output
For each test case, output one single line, containing one of the four strings “total eclipse”, “partial eclipse”, “annular eclipse” or “no eclipse at all” (Quotes exclusive) , according to which of the four situations occurs in the test case. It is guaranteed that, when the coordinates of the observer change slightly (for example, 10-4), the answer will not change.

Sample Input
3 1 5 0 0 10 0 0
0 0 0 0 0 0 0 0

Sample Output
annular eclipse

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-08-05 16:44
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?