编程介的小学生 2017-09-26 08:13 采纳率: 20.5%
浏览 845
已采纳

Hanzo vs. Genji

Problem Description
“Real life is not like the story our father told us.”
Hanzo just shot an arrow at Genji. Please help him to find out whether that arrow will hit Genji’s
head directly.

Input
The input contains multiple test cases.

The first line contains an integer T(1≤T≤10000), the number of test cases.

Then T test cases follows. In each test case:

The first line contains a vector S, the initial position of Hanzo’s arrow.

The second line contains two positive integers l and r, which means that Hanzo’s arrow can be recognized as a cylinder with a radius of r and a height of 2l. We always use the position of the centroid of the cylinder to indicate the position of the cylinder. Initially the centroid is at S.

The third line contains a vector V , the initial velocity of Hanzo’s arrow.

The fourth line contains a vector G(|G| > 0), the acceleration of gravity. The position of the centroid of the cylinder moves according to V and G. When the arrow is flying, the line connecting the centers of the two circles’ surfaces of the cylinder is always the tangent line to the trajectory of the centroid at the point of the centroid. (Consider yourself throwing a telegraph pole if you don’t understand the movement of the arrow.)

And the last line contains a vector D, the position of Genji’s head. We consider Genji’s head as a single point. The arrow hits his head when D is on the surface or in the cylinder.

Initially, D has no intersection with the cylinder. It is guaranteed that if the arrow will not hit Genji’s head, the distance between Genji’s head and the arrow will always be no less than 10−6. All the vectors are represented by three numbers which are the three-dimensional cartesion coordinates of that vector.

All the input numbers are integers and their absolute values are bounded by 1000, except for the number of test cases T.

Output
For each test case, output whether the arrow will hit Genji’s head. (Please see the sample input and output for details.)

Sample Input
2
0 0 0
1 1
1 0 0
0 -1 0
10 0 0
0 0 0
1 1
1 0 0
0 -1 0
2 -2 0

Sample Output
Case #1: NO
Case #2: YES

  • 写回答

2条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP