Pythagoras Theorem
Author: Zen Biker Maniac
Date: 13/09/2006

Moving the two blue points changes the size and shape of the triangle.
The sliders demonstrate that the two small squares equal the big one.

1

2

3

a_r = 1 (slider from 0 to 1, step 0.01)
B = Point(xAxis)
A = Intersect(xAxis, yAxis)
O = Midpoint(A, B)
o = Circle(O, B)
C = Point(o)
D = Rotate(C, 90°, A)
E = Rotate(A, 270°, C)
m = Line(D, E)
v_b = Vector(D, E)
k_b = Length(v_b)
F = Rotate(C, 270°, B)
G = Rotate(B, 90°, C)
n = Line(F, G)
H = Intersect(m, n)
hc = Line(H, yAxis)
u_a = Vector(E, H)
ku_b = Length(u_a)
u_b = Vector(G, H)
ku_a = Length(u_b)
v_a = Vector(F, G)
k_a = Length(v_a)
I = Rotate(B, 270°, A)
v_c = Vector(A, I)
k_c = Length(v_c)
d = Circle(H, ku_a ku_b / k_c)
K, L = Intersect(d, hc)
v_h = Vector(H, L)
k_H: k_a k_b / k_c
sliderA_m: ku_b + k_H + k_c
a: 1 - a_r
ka_1: ku_b / sliderA_m
ka_2: (ku_b + k_H) / sliderA_m
J = Rotate(A, 90°, B)
sliderB_m: ku_b + k_H + k_c
b = 0 (slider from 0 to 1, step 0.01)
F' = If(a < ka_1, Point[F, a / ka_1 u_b], If[a < ka_2, Point[F, u_b], Point[F, u_b + (a - ka_2) / (1 - ka_2) v_c]])
poly2, b_1, c, g, f = Polygon(B, C, G, F)
k_3: (ku_b + k_H + k_c) / sliderA_m
G' = If(a < ka_1, Point[G, a / ka_1 u_b], If[a < ka_2, Point[H, (a - ka_1) / (ka_2 - ka_1) v_h], Point[L, (a - ka_2) / (1 - ka_2) v_c]])
Ca' = If(a < ka_1, C, If[a < ka_2, Point[C, (a - ka_1) / (ka_2 - ka_1) v_h], Point[C, v_h + (a - ka_2) / (1 - ka_2) v_c]])
u = Vector(G', Ca')
B' = If(a < ka_1, B, If[a < ka_2, B, Point[B, (a - ka_2) / (1 - ka_2) v_c]])
v = Vector(F', B')
Q, b', c', g', f' = Polygon(B', Ca', G', F')
kb_1: ku_a / sliderB_m
kb_2: (ku_a + k_H) / sliderB_m
E' = If(b < kb_1, Point[E, b / kb_1 u_a], If[b < kb_2, Point[H, (b - kb_1) / (kb_2 - kb_1) v_h], Point[L, (b - kb_2) / (1 - kb_2) v_c]])
D' = If(b < kb_1, Point[D, b / kb_1 u_a], If[b < kb_2, Point[D, u_a], Point[D, u_a + (b - kb_2) / (1 - kb_2) v_c]])
Cb' = If(b < kb_1, C, If[b < kb_2, Point[C, (b - kb_1) / (kb_2 - kb_1) v_h], Point[C, v_h + (b - kb_2) / (1 - kb_2) v_c]])
A' = If(b < kb_1, A, If[b < kb_2, A, Point[A, (b - kb_2) / (1 - kb_2) v_c]])
poly1, a_1, c_1, e, d_1 = Polygon(A, C, E, D)
S, a', cb', e', d' = Polygon(A', Cb', E', D')
poly3, a_2, b_2, j, i = Polygon(A, B, J, I)
α = Angle(A, C, B)
M = Midpoint(C, B)
N = Midpoint(A, C)
U = Point(poly1)
poly1_1, u_1, c_2, b_3 = Polygon(C, B, U)