1

x

A = (-5.174773309638967, 3.320863018750294)
b = OrthogonalLine(A, xAxis)
a = OrthogonalLine(A, yAxis)
N = Point(a)
c, d = AngularBisector(a, b)
topLeft = Point(c)
f = OrthogonalLine(topLeft, b)
e = OrthogonalLine(topLeft, a)
C = Point(e)
g = OrthogonalLine(C, e)
M = Point(g)
L = Point(g)
one = Segment(L, M)
D = Point(g)
thex = Segment(C, D)
k = Circle(topLeft, thex)
E = Intersect(k, f, 1)
i = OrthogonalLine(E, f)
I = Intersect(a, i)
l = Ray(I, N)
R = Point(l)
a_1 = Segment(I, R)
F = Intersect(k, e, 2)
j = OrthogonalLine(F, e)
G = Intersect(c, i)
K = Intersect(a, e)
m = Segment(K, I)
K' = Mirror(K, c)
I' = Mirror(I, c)
m' = Segment(K', I')
I_1 = Point(b)
e_3 = Ray(I', I_1)
S = Mirror(R, c)
J = Point(e_3)
f_3 = Segment(J, S)
p: floor(Distance[I, R] / Length[one])
across = Segment(I, (x(I) + (p * Length[one]), y(I)))
q: floor(Distance[F, S] / Length[one])
down = Segment(J, (x(J), y(J) - (q * Length[one])))
scale = Length(one)
side = Sequence((x(J), y(J) - (i * scale)), i, 1, q)
top = Sequence((x(I) + (i * scale), y(I)), i, 1, p)
topEdge = Segment(topLeft, (x(E) + (p * scale), y(E)))
sideEdge_1 = Segment(topLeft, (x(F), y(F) - (q * scale)))
horizontal = Sequence(Segment[(x(F), y(F) - (i * scale)), (x(G) + (p * scale), y(F) - (i * scale))], i, 0, q)
vertical = Sequence(Segment[(x(E) + (i * scale), y(E)), (x(E) + (i * scale), y(F) - (q * scale))], i, 0, p)
plus: p + q
times: (p * q)
text1: "(x+" + (LaTeX[p]) + ")(x+" + (LaTeX[q]) + ")=x^2+" + (LaTeX[plus]) + "x+" + (LaTeX[times]) + ""
x2, topleft, e_1, g_1, f_1 = Polygon(topLeft, E, G, F)
topxs, g_2, e_2, h, n = Polygon(G, E, (x(E) + (p * scale), y(E)), (x(G) + (p * scale), y(G)))
topxs' = Mirror(topxs, c)
ones, g_3, r, s, t = Polygon(G, (x(G) + (p * scale), y(G)), (x(G) + (p * scale), y(G) - (q * scale)), (x(G), y(G) - (q * scale)))