On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored.
Currently the ball stands still at point AA, then we'll give it an initial speed and a direction. If the ball hits the cylinder, it will bounce back with no energy losses.
We're just curious about whether the ball will pass point BB after some time.
Currently the ball stands still at point AA, then we'll give it an initial speed and a direction. If the ball hits the cylinder, it will bounce back with no energy losses.
We're just curious about whether the ball will pass point BB after some time.
Every test case contains three lines.
The first line contains three integers OxOx, OyOy and rr, indicating the center of cylinder is (Ox,Oy)(Ox,Oy) and its radius is rr.
The second line contains four integers AxAx, AyAy, VxVx and VyVy, indicating the coordinate of AA is (Ax,Ay)(Ax,Ay) and the initial direction vector is (Vx,Vy)(Vx,Vy).
The last line contains two integers BxBx and ByBy, indicating the coordinate of point BBis (Bx,By)(Bx,By).
⋅⋅ 1 ≤ TT ≤ 100.
⋅⋅ |OxOx|,|OyOy|≤ 1000.
⋅⋅ 1 ≤ rr ≤ 100.
⋅⋅ |AxAx|,|AyAy|,|BxBx|,|ByBy|≤ 1000.
⋅⋅ |VxVx|,|VyVy|≤ 1000.
⋅⋅ Vx≠0Vx≠0 or Vy≠0Vy≠0.
⋅⋅ both A and B are outside of the cylinder and they are not at same position.
2 0 0 1 2 2 0 1 -1 -1 0 0 1 -1 2 1 -1 1 2
Case #1: NoCase #2: Yes
给一个点,给它前进的方向,地图上有一个圆,撞到圆会反弹,问这个点会不会经过一个点输入:圆心坐标x,y,半径,r;第二行这个点坐标和速度方向第三行判定点B坐标;输出:能否经过Yes,No;解题思路:这是一个计算几何的数学题;我们就要分析这个球与圆相撞的两种情况,一种是与圆相切或相离,这样就直接判断求解就好了另一种是相撞,相撞就可以看这个点是否在相撞之前。不在就看折射这条线上有没有就可以了具体详细题解这个博客写非常好,哎 心好累 看了好多遍 写了好多遍。。。http://blog.youkuaiyun.com/Apm__5/article/details/51930198