[Math] How To Scale A Rectangle

geometry

I know this is probably pretty easy for people on this site but I am no mathematician so I thought I would ask here. I am looking for a formula for scaling a rectangle from an arbitrary point as in NOT THE CENTER. The point will always be inside the rectangle however and the scale is also arbitrary.

Best Answer

If you have a function for scaling the rectangle from the center (I'm thinking you mean the rectangle is scaled and the center of the rectangle does not move), then you can combine that function with a pair of translations to achieve a transform that scales the rectangle while keeping some arbitrary other point fixed. Suppose you want to scale by $s$ and keep a point $p$ fixed. Then your function should transform a vertex, $v$, of the rectangle like:

$v\mapsto s(v - p) + p$.

This is essentially combining three simple transformations. First we send the fixed point you want to the origin $v' = v - p$. Then we scale everything $v'' = s v'$. Finally, we undo the first translation, to get back to the original coordinate system, $v''' = v'' + p$.