I need a Linear Transformation for following usecase:
I have an 2D space and a certain boundary (minX, minY, maxX, maxY). With boundary I mean, that I consider only vectors which are inside a certian parallelogram, where its left down corner is the vector (minX, minY) and its right upper corner is the vector (maxX, maxY) : see blue area of first attachment.
How can I transform a vector inside this parallelogram so that it is projected inside [a,b] x [a,b] (see red area of first attachment)
an example: [0,1] x [0,1]
But, the following must apply:
the vector of the left down corner of the parallelogram must become (a,a) and the vector of the right upper corner must become (b,x) with x <= b
(see second attachment)
it is important that the parallelogram does not loose its form, so it must not become a square (see second attachment). This is the reason why the right upper corner must not become (b,b) . Only if the original boundaries form a square.
update: I have uploaded some pictures, which illustrate the problem.
hope you can help,