I have rotated an image and need to get the new coordinates of a smaller image to be placed on the rotated image.
Assuming the small image's coordinates on the unrotated large image are:
$x0 = 100;
$x1 = 120;
$y0 = 100;
$y2 = 200;
And the clockwise rotation performed on the large image is:
$rotation = -3.5;
How can I now get the updated coordinates for placing the small image onto the larger (now rotated) image?
(Disclaimer: This question is specifically how to calculate the new coordinates in PHP after a rotate of an image, so it is not a duplicate of other "coordinates after rotate" questions, which don't deal with how to solve this problem in PHP code, with 0,0 being top left corner and using PHP functions.)