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

Distance and Speed Testing

There are two round tracks intersecting at point A(a_x,a_y) and B(b_x,b_y), where a_y > b_y. The coordinate of the centers of the two tracks are (x1,y1) and (x2,y2). To simplify the problem, we assume that neither centers of tracks is in another track. That is the distances between two centers are longer than max(r1,r2). Now there are tow cars each running on one track (of course in different tracks) with the same direction (both in anticlockwise or both in clockwise) starting from A. After one loop we find they arriving at A at the same time. From geometry theorem we know there is always a fixed point P, from which the tow distances to the two cars are equal at any time. That is, assuming that d1 is the distance between P and one car ,d2 is the distance between P and another car, if the speeds of the tow cars neither change, d1=d2 satisfies at any time. Then if we find the two distances are not equal, we can make a conclusion that the speed of the tow cars changes(may be one or both change). Your task is to calculate the exact position of P, given the two round tracks' position and radius.

Input

In the first line of the input there is a number 1<= N <= 20 indicating the number of cases. Then following N lines, each line defining one case. Each line include 6 integers x1, y1, r1, x2, y2, r2, where x1, y1, r1, represent the first circle's x-coordinate, y-coordinate and radius while x2, y2, r2 represent the second circle. They are separated by one space. All integers are between (-10,10).

Output

For each case ,output the coordinate of point p in one line in this format: (x,y).

Sample Input

2
-1 0 2 1 0 2
-3 3 4 -6 6 3

Sample Output

(0.00,1.73)
(-2.00,5.83)

  • 写回答

1条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥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,如何解決?
  • ¥15 c++头文件不能识别CDialog