Scaling relative to a fixed point
Actually, we can control the location of a scaled object by choosing a positin , called the fixed point (xf, yf), that is to remain unchanged after the scaling transformation.
Scaling relative to a fixed point (xf, yf) : x'= x*xScale +xf*(1-xScale) y'= y*yScale+yf*(1-yScale) |
|---|

Scaling relative to the fixed point (2,2), with xScale=2 and yScale=2
Let's consider the point (3,2), scaling relative to a fixed point (2, 2) : x'= 3*2 +2*(1-2) = 4 y'= 2*2+2*(1-2) = 2 |
|---|
Let's consider the point (1,3), scaling relative to a fixed point (2, 2) : x'= 1*2 +2*(1-2) = 0 y'= 3*2+2*(1-2) = 4 |
|---|
Let's try !
