|
||||||||||
Rotating a FrameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 174 Accepted Submission(s): 54 Problem Description Suppose you have an ice hockey ball (Which has the shape of a cylinder as shown in the figure) and a photo frame (a rectangle). You place the ball in one corner of the photo frame and keep the balls position and orientation fixed. Now you start rotating the frame in clockwise direction. But as the sides of the frame and of the ball have high friction so while the frame is rotating its surface and the balls surface never slips. So the frame always has a constant angular velocity as well as a tangential velocity as shown in the figure below. Write a program to find the position of the frame after certain time. Input he input contains several test cases. Each set of input is contained in two lines. The first line of a set contains eight integers which denote the values x1, y1, x2, y2, x3, y3 and x4, y4 respectively. These values indicate that the four vertices of the frame in clockwise order are denoted by the Cartesian coordinates P1 (x1, y1) , P2 (x2, y2) , P3 (x3, y3) and P4 (x4, y4) . You can assume that 0<=| x1|,| y1|,| x2|,| y2|,| x3|,| y3|,| x4|,| y4|<=1000 . The second line contains three floating point numbers which denotes the values of R (0 < R < 1000) , T (0<=T < 100000) and (0<= < 360) respectively. Here R is the radius of the ice hockey ball, T denotes that we want to know the position of the frame after T seconds and is the angular velocity of the frame in degree/second. You can assume that ball is placed touching two the si! des that intersect at point (x1, y1) and it never moves from or rotates in that position. There will be no such input where the hockey ball cannot be placed within the frame. The last test case is followed by a single zero, which should not be processed. Output For each test case, print the case number and eight floating point numbers x1f, y1f, x2f, y2f, x3f, y3f, x4f and y4f , to three decimal places. These floating-point numbers actually denote the final positions of the points (x1, y1),(x2, y2),(x3, y3) and (x4, y4) (The four corners of the frame) respectively after time T seconds. Sample Input
Sample Output
Source | ||||||||||
|