编程介的小学生 2019-03-22 22:04 采纳率: 20.5%
浏览 340

圆上切线的坐标角度的计算问题,如何利用C语言的形式解答?

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler