How to construct the combined transformation matrix that adjusts this rectangle.

807 Views Asked by At

example

Like what is shown above, dashed line constructed rectangle is the original one, and the solid constructed rectangle is the target we want to transform.

So we can see that points of the original one are (-1,0)(1,0)(-1,5)(1,5) and the points of target are (-5,2)(-5,3)(5,2)(5,3). Construct the combined transformation matrix that adjusts this rectangle.

The idea I use is to find the changes of scalling and translating Sx Sy Tx and Ty. And then plug these number I find into these two and multiply them together.equation

Then I find

Sx = 5

Sy = 1/5

Tx = -4

Ty = 2 Such that stepone

When I tried (-1,0) to test it, what I want to get is (-5,2) But I got result

What is wrong with my process? I am not sure how to translate shape if the negative quadrant occurs?

Also, I tried to translate one corner of the original one to the origin. So that Sx = 1

Sy = 1

Tx = 1

Ty = 0

And then I got try two When I test (-1,0), it works. And then I don't know what should I do.

1

There are 1 best solutions below

2
On

The scaling is with respect to the origin. You need to translate the old rectangle so that its center is the origin, re-scale it, then translate it back.