1

x

x

x

x^2

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 = Point(e_3)
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, h, n, r, s, B, H = Polygon(topLeft, F, 4)
topxs, t, b_1, c_1, d_1 = Polygon(B, E, (x(E) + (p * scale), y(E)), (x(B) + (p * scale), y(B)))
leftxs, e_1, f_1, g_1, h_1 = Polygon(B, F, (x(F), y(F) - (q * scale)), (x(B), y(B) - (q * scale)))
ones, b_2, i_1, j_1, k_1 = Polygon(B, (x(B) + (p * scale), y(B)), (x(B) + (p * scale), y(B) - (q * scale)), (x(B), y(B) - (q * scale)))
O = (3.0587725659918696, 1.964803632957889)
P = (4.984185080381743, 1.9793900914002367)
poly1, l_1, m_1, n_1, p_1, Q, T = Polygon(O, P, 4)
U = Midpoint(l_1)
V = Midpoint(p_1)
W = Midpoint(n_1)
Z = Midpoint(m_1)
q_1 = Segment(U, W)
r_1 = Segment(V, Z)
text4: "+" + (LaTeX[p]) + ""
text6: "+" + (LaTeX[p]) + "x"
text7: "+" + (LaTeX[q]) + ""
text8: "+" + (LaTeX[q]) + "x"
text9: "" + (LaTeX[times]) + ""