Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Image Rotation
Description These days, Hunk is developing a special software for 2D digital image rotation. Here, the input image is described in the coordinate system shown in Figure 1 where the leftmost pixel of the image lies on the He considers the following: - Each image is a rectangle tiled with pixels. Pixels have discrete positions. The positions of their centers are referred to as their positions, which are usually denoted by order pairs of numbers (
*y*,*x*). In most cases, the dimensions of an image will change after rotation. As shown in Figure 3, rotating the original image (the blue rectangle) around its center will produce a new image (the red rectangle) with different height and width. - Positions of pixels in the original image after rotation generally don't coincide with those of pixels in the new image. Rounding them to the nearest pixels might incur loss of image quality. An inverse transform method is used to tackle the difficulty. For each pixel in the new image, its position in the original image is computed using an inverse transform corresponding to the rotation to determine its color information.
The task is, for an image of Input The input consists of multiple test cases. Each test case consists of one line containing two positive integers Process to the end of input. Output For each test case, first output one line containing two integer H and W separated by one space meaning the new image has Sample Input 3 3 90 3 4 60 Sample Output 3 3 (2.00,2.00) (1.00,2.00) (0.00,2.00) (2.00,1.00) (1.00,1.00) (0.00,1.00) (2.00,0.00) (1.00,0.00) (0.00,0.00) 4 4 (-1.00,-1.00) (-1.00,-1.00) (-1.00,-1.00) (-1.00,-1.00) (-1.00,-1.00) (1.93,1.88) (1.07,2.38) (0.20,2.88) (-1.00,-1.00) (1.43,1.02) (0.57,1.52) (-1.00,-1.00) (-1.00,-1.00) (0.93,0.15) (0.07,0.65) (-1.00,-1.00) Hint If the rotated image has dimensions l, then its dimensions in pixels are (floor(_{w}l) + 1) × (floor(_{h}l) + 1)._{w}Make sure that your solution won’t output anything like “−0.00”. Source POJ Monthly--2006.09.29, zby03 |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator