|
x,y represent the original image coordinates, and X,Y represent the new image coordinates.
X = (x-100) * cos60-(y-260) * sin60 + 100; (1)
Y = (x-100) * sin60 + (y-260) * cos60 + 260; (2)
Generally, the rotated image will be larger than the original image, and its width and height can be calculated from the four vertices of the original image.
From (1) and (2), we can inversely deduce the corresponding position of each point in the rotated image in the original image.
x = (X-100) * cos60 + (Y-260) * sin60 + 100; (3)
y = (Y-260) * cos60-(X-100) * sin60 + 260; (4) |
|