An Easy Physics Problem (hdu5572) 2015ACM/ICPC亚洲区上海站

本文探讨了一个计算几何问题:在一个无限光滑的平面上,一个小球从指定位置出发,以特定方向移动,遇到固定圆柱会发生完全弹性碰撞。问题在于确定小球是否会经过另一个指定点。文章分析了球与圆柱相撞的几种情况,并提供了详细的解题思路。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.
Input
First line contains an integer TT, which indicates the number of test cases. 

Every test case contains three lines. 

The first line contains three integers OxOxOyOy and rr, indicating the center of cylinder is (Ox,Oy)(Ox,Oy) and its radius is rr

The second line contains four integers AxAxAyAyVxVx 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. 

 Vx0Vx≠0 or Vy0Vy≠0

 both A and B are outside of the cylinder and they are not at same position.
Output
For every test case, you should output " Case #x: y", where xx indicates the case number and counts from 11yy is " Yes" if the ball will pass point BB after some time, otherwise yy is " No".
Sample Input
2
0 0 1
2 2 0 1
-1 -1
0 0 1
-1 2 1 -1
1 2
Sample Output
Case #1: No

Case #2: Yes

给一个点,给它前进的方向,地图上有一个圆,撞到圆会反弹,问这个点会不会经过一个点
输入:圆心坐标x,y,半径,r;
           第二行这个点坐标和速度方向
            第三行判定点B坐标;
输出:能否经过Yes,No;
解题思路:
这是一个计算几何的数学题;
我们就要分析这个球与圆相撞的两种情况,一种是与圆相切或相离,这样就直接判断求解就好了
另一种是相撞,相撞就可以看这个点是否在相撞之前。不在就看折射这条线上有没有就可以了
具体详细题解这个博客写非常好,哎 心好累 看了好多遍 写了好多遍。。。

http://blog.youkuaiyun.com/Apm__5/article/details/51930198

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值