UVA 11880 Ball in a Rectanglefds

运动问题,有边界,入射角等于出射角

所以x、y分别按周期变化

Description

Download as PDF
Input: Standard Input Output: Standard Output

  There is a rectangle on the cartesian plane, with bottom-left corner at (0,0) and top-right corner at (LW). There is a ball centered at (x,y), with radius=R, shown below

\epsfbox{p11880.eps}

At time 0, the ball starts to move along a ray with polar angle a (the angle from positive x-axis to the ray, rotating counter-clockwise). When hitting the rectangle boundary, the reflex angle always equals to the incidence angle. The ball's velocity is always v (i.e. it never changes when hitting the rectangle). Where is the center of the ball at time s?

Input 

There will be at most 25 test cases, each contains a line with 8 integers  LWxyRavs (  100$ \le$LW$ \le$1091$ \le$R$ \le$5R$ \le$x$ \le$L - RR$ \le$y$ \le$W - R0$ \le$a < 3601$ \le$vs$ \le$109), as stated above. The input terminates with  L = W = x = y = R = a = v = s = 0, which should not be processed.

Output 

For each test case, output a line containing two floating-point numbers  xy, rounded to two decimal points, indicating that the center of ball will be at  (xy) at time  s.

Sample Input 

100 100 80 10 5 90 2 23
110 100 70 10 5 180 1 9999
0 0 0 0 0 0 0 0

Sample Output 

80.00 56.00
71.00 10.00



Problemsetter: Rujia Liu, Special Thanks: Yiming Li, Shamim Hafiz & Sohel Hafiz

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值