I am trying to convert the rotation and crop rectangle settings of an old graphics editor to new editor which uses different coordinate system than the old one. The following picture illustrates the problem:
All the rectangles have the same aspect ratio (e.g. 3:2), and all the coordinates are normalized across the edges (ie from 0 to 1 in both X and Y direction).
The old program saves the coordinates of corners of the blue rectangle C given in the coordinate system aligned with the green rectangle (with origin at A), and the angle of rotation of yellow rectangle.
The new program needs the coordinates of the corners of the blue rectangle in the coordinate system aligned with the yellow rectangle (with origin at B). How do I do the transformation from old to new?
This seems like a simple math problem, but it has been so many years since the math classes that I could not figure this out with pen-and-paper nor searching this site (many similar questions, but I could not find quite a matching one...)