Similar Rectangles

A = (1, 2)
B = (1, 4)
C = (2, 4)
D = (2, 2)
poly1, a, b, c, d = Polygon(A, B, C, D)
E = (4, 2)
ratio = 1.5 (slider from 0 to 5, step 0.25)
F = Point(Circle[E, ratio d])
f = Segment(E, F)
g = OrthogonalLine(F, f)
h = Circle(F, ratio c)
G = Intersect(h, g, 2)
i = OrthogonalLine(G, g)
j = OrthogonalLine(E, f)
H = Intersect(i, j)
poly2, e_1, f_1, g_1, h_1 = Polygon(E, F, G, H)