编程介的小学生 2017-12-09 16:19 采纳率: 20.5%
浏览 874
已采纳

Where am I

Problem Description
I am a ball on a circle table. The table's surface is so smooth that I can move without energy lost.
Now you are to give me a hit vector, I want to know where I will be after T seconds. Collisions between me and the edge of the table satisfy Conservation of Momentum Theorem , also my speed after collision is as fast as before. Look for the figure below to know it more clearly:

Input
The first line contains a number N, the number of test cases you have to proceed.
Each test case has three lines.First line has three numbers, x1,y1,r1, the center and radius of the table. Second line has x2,y2,r2, the parameters of me (the ball). The third line consists of dx, dy, T: (dx,dy) is the hit vector, T is the time I have moved since you hit me. To explain hit vector: if I am at position (x0,y0) now ,next second I will be at position (x0+dx,y0+dy) without conllision. All input numbers are non-negative integer and less than 10^6.Also you can assume the ball must be in the table.

Output
Please output two float number x , y,which mean the center position of the ball after T seconds and round to just one decimal places.

Sample Input
2
5 5 10
5 5 1
1 0 30
1 1 10
1 0 2
1 1 100

Sample Output
-1.0 5.0
3.4 -0.5

  • 写回答

1条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏