$O$

完全平方和\ (a+b)²=a²+2ab+b²

$d=%v$

$P$

$a²$

$a$

$a$

$ba$

$b$

$a$

$b²$

$b$

$b$

$ab$

$a$

$b$

P

Forward

O = (6.04, -2.74)
d = 0 (slider from 0 to 0.3, step 0.001)
ray = Ray(O, O + (1, 0))
A_1 = Point(ray)
d0 = Distance(O, A_1)
A_3: O + (0, d0)
A_2: O + (d0, d0)
P = Point(Segment[O + (0.8, 0), A_1 - (0.8, 0)])
d1 = Distance(O, P)
Q: O + (d1, d1)
B_1: (x(P), y(A_3))
B_2: (x(O), y(Q))
B_3: (x(A_1), y(Q))
poly1, h_{12}, h_{13}, h_{14}, h_5 = Polygon(O, P, Q, B_2)
poly2, h_8, h_9, h_{10}, h_{11} = Polygon(A_1, P, Q, B_3)
poly3, h_1, h_4, h_{15}, h_6 = Polygon(A_2, B_1, Q, B_3)
poly4, h_2, h_7, h_{16}, h_3 = Polygon(A_3, B_1, Q, B_2)
u_1 = Vector(Q, A_2)
u_2 = Vector(Q, A_3)
u_3 = Vector(Q, O)
u_4 = Vector(Q, A_1)
O' = Translate(O, Vector[(d * u_3)])
P' = Translate(P, Vector[(d * u_3)])
Q' = Translate(Q, Vector[(d * u_3)])
A = Translate(B_2, Vector[(d * u_3)])
polya, a_2, a_3, a_4, a_1 = Polygon(O', P', Q', A)
B = Translate(A_1, Vector[(d * u_4)])
P'_1 = Translate(P, Vector[(d * u_4)])
Q'_1 = Translate(Q, Vector[(d * u_4)])
C = Translate(B_3, Vector[(d * u_4)])
polyb, b_2, b_1, b_4, b_3 = Polygon(B, P'_1, Q'_1, C)
D = Translate(A_2, Vector[(d * u_1)])
E = Translate(B_1, Vector[(d * u_1)])
Q'_2 = Translate(Q, Vector[(d * u_1)])
F = Translate(B_3, Vector[(d * u_1)])
polyc, c_4, c_1, c_2, c_3 = Polygon(D, E, Q'_2, F)
G = Translate(A_3, Vector[(d * u_2)])
H = Translate(B_1, Vector[(d * u_2)])
Q'_3 = Translate(Q, Vector[(d * u_2)])
I = Translate(B_2, Vector[(d * u_2)])
polyd, d_4, d_3, d_2, d_1 = Polygon(G, H, Q'_3, I)
square_1, e_2, e_3, e_4, e_1 = Polygon(O', P', Q', A)
square_2, g_1, g_6, g_7, g_2 = Polygon(B, P'_1, Q'_1, C)
square_3, f_4, f_1, f_2, f_3 = Polygon(D, E, Q'_2, F)
square_4, g_3, g_4, g_8, g_5 = Polygon(G, H, Q'_3, I)
n = 0 (slider from 0 to 8, step 1)
poly0, a, b, c, e = Polygon(O, O + (d0, 0), O + (d0, d0), O + (0, d0))
J = (-4.18, 4.22)
text1: "(a+b)²=" + (LaTeX[If[n ≥ 1, "(a+b)(a+b)"]]) + "
\cr" + (LaTeX[If[n ≥ 4, "=a^2+ab+ba+b^2"]]) + "
\cr" + (LaTeX[If[n ≟ 8, "=a^2+2ab+b^2"]]) + ""
Rec1, f, g, h, i = Polygon(J + (4.7, 0), J + (9, 0), J + (9, -1), J + (4.7, -1))
Rec2, j, k, l, m = Polygon(J + (6.2, 0), J + (9, 0), J + (9, -1), J + (6.2, -1))
Rec4, p, q, r, s = Polygon(J + (1.8, (-1.1)), J + (7, (-1.1)), J + (7, (-2.1)), J + (1.8, (-2.1)))
Rec5, t, i_1, j_1, k_1 = Polygon(J + (3.6, (-1.1)), J + (7, (-1.1)), J + (7, (-2.1)), J + (3.6, (-2.1)))
Rec6, l_1, m_1, n_1, p_1 = Polygon(J + (5.3, (-1.1)), J + (7, (-1.1)), J + (7, (-2.1)), J + (5.3, (-2.1)))