I have a math problem for some code I am writing. I don't have much experience with 2D transformations, but I am sure there must be a straight-froward formula for my problem.
I have illustrated it here:
My goal is to work out the co-ordinates of (Xp2, Yp2).
Shape A is a quadrilateral that exists that can exist anywhere in 2D space. Its four co-ordinates are known. It contains a point (Xp1, Yp1), which are also known.
Shape B is a rectangle with one corner at (0,0). The height and width are variable, but known.
Shape A needs to be transposed to Shape B so that the new position of the point inside can be calculated.
How do I work out the new co-ordinates of (Xp2, Yp2)?