$ 0 0 math.stackexchange.com/questions/1095827/scaling-and-rotating-a-square-so-that-it-is-inscribed-in-the-original-square Below is a rather primitive implementation of the above in Mathematica, for n=7 and gradually incrementing λ∈[0.05,0.95] :