I am needing to get the position of a point after rotation. This is a bit complicated because my height and width change after rotation and it does not rotate around the center point. Given the 2 images below. The first image is my unrotated image. The second is after an 80 degree clockwise rotation. What I am needing is to get the new top left position of the first "T". Just eye balling it in an image editor the top left pixel of the T has moved about 50 points to the right and just a few points down. But I am not sure how to calculate this?
My specialty is web development and not Math so I am hoping someone can help explain the formula needed to accomplish this.
Roughly speaking you need to figure out the displacement after rotation. It seems that the displacement is determined by the placement of the new image in a bounding box. For simplicity, assume that the image origin is in the lower left corner (often this is not the case). The convention for images is that all pixels have positivie coordinates. So when you rotate the lower right corner, its y coordinate in going to be negative, so it needs to be shifted up to get back to 0. Same process has be done for the other four corners. Then you should be able to tell what the shift needs to be to fit it in image coordinates. This is the same shift that needs to be done to any other point in the image.
So for any point rotate then shift by the amount you figured out. The tricky point is figuring out the shift, but you can do this by tracking the corners of the original image.