(* ROTATION MATRIX *)
R[θ_]:={{Cos[θ],-Sin[θ]},{Sin[θ],Cos[θ]}};
(* POSITION VECTOR *)
a[θ_]:={Cos[θ],Sin[θ]};
b[θ_]:={0,0};
c[θ_]:={Cos[θ],0};
d[θ_]:={0,-Cos[θ]};
e[θ_]:={Cos[θ],-Cos[θ]};
f[θ_]:={Cos[θ]+Sin[θ],0};
g[θ_]:={Cos[θ]+Sin[θ],Sin[θ]};
h[θ_]:={Cos[θ]-Sin[θ],Sin[θ]+Cos[θ]};
i[θ_]:={-Sin[θ],Cos[θ]};
j[θ_]:={Cos[θ]^3,Cos[θ]^2 Sin[θ]};
k[θ_]:={Cos[θ]^3-Sin[θ],Cos[θ]^2 Sin[θ]+Cos[θ]};
(* MOVING POINT OF SQUARE BDEC *)
(* STEP 1 *)
ePrime1[θ_,t1_]:=e[θ]+t1(a[θ]-c[θ]);
cPrime1[θ_,t1_]:=c[θ]+t1(a[θ]-c[θ]);
(* STEP 2 *)
dPrime2[θ_,t2_]:=R[π/2 t2].d[θ];
ePrime2[θ_,t2_]:=R[π/2 t2].(a[θ]+(d[θ]-b[θ]));
cPrime2[θ_,t2_]:=R[π/2 t2].a[θ];
(* STEP 3 *)
dPrime3[θ_,t3_]:=c[θ]+t3(j[θ]-c[θ]);
ePrime3[θ_,t3_]:=ePrime2[θ,1]+t3(j[θ]-c[θ]);
(* UNIFYING STEPS *)
dPrime[θ_,t_]:=Piecewise[{
{d[θ],0≤t≤1},
{dPrime2[θ,t-1],1≤t≤2},
{dPrime3[θ,t-2],2≤t≤3}
}];
ePrime[θ_,t_]:=Piecewise[{
{ePrime1[θ,t],0≤t≤1},
{ePrime2[θ,t-1],1≤t≤2},
{ePrime3[θ,t-2],2≤t≤3}
}];
cPrime[θ_,t_]:=Piecewise[{
{cPrime1[θ,t],0≤t≤1},
{cPrime2[θ,t-1],1≤t≤2},
{i[θ],2≤t≤3}
}];
(* MOVING POINT OF SQUARE AGFC *)
(* STEP 1 *)
fPrime1[θ_,t1_]:=f[θ]+t1(b[θ]-c[θ]);
CPrime1[θ_,t1_]:=c[θ]+t1(b[θ]-c[θ]);
(* STEP 2 *)
gPrime2[θ_,t2_]:=R[-π/2 t2].(g[θ]-a[θ])+a[θ];
fPrime2[θ_,t2_]:=R[-π/2 t2].((b[θ]+(g[θ]-a[θ]))-a[θ])+a[θ];
CPrime2[θ_,t2_]:=R[-π/2 t2].(b[θ]-a[θ])+a[θ];
(* STEP 3 *)
gPrime3[θ_,t3_]:=c[θ]+t3(j[θ]-c[θ]);
fPrime3[θ_,t3_]:=fPrime2[θ,1]+t3(j[θ]-c[θ]);
(* UNIFYING STEPS *)
gPrime[θ_,t_]:=Piecewise[{
{g[θ],0≤t≤1},
{gPrime2[θ,t-1],1≤t≤2},
{gPrime3[θ,t-2],2≤t≤3}
}];
fPrime[θ_,t_]:=Piecewise[{
{fPrime1[θ,t],0≤t≤1},
{fPrime2[θ,t-1],1≤t≤2},
{fPrime3[θ,t-2],2≤t≤3}
}];
CPrime[θ_,t_]:=Piecewise[{
{CPrime1[θ,t],0≤t≤1},
{CPrime2[θ,t-1],1≤t≤2},
{h[θ],2≤t≤3}
}];

f[]:=DynamicModule[{list1,list2, θ,t,s,o},

Column[{

Pane@Style["Pythagorean Theorem",Bold, Orange,20],
Pane@" ",
Pane@"Pythagorean Theorem, is a relation in Euclidean",
Pane@"geometry among the three sides of a right triangle.",
Pane@"It states that the square of the hypotenuse i.e. the ",
Pane@"side opposite the right angle, is the equal to the",
Pane@"sum of the squares of the other two sides:",
Pane@" ",
,
Pane@" ",
Pane@Style["Visual Proof:",Bold],
Pane@" ",
Pane@"Follow the transformation of the squares into the", 
Pane@"parallelograms. Verify at each stage the area of the",
Pane@"parallelogram is constant and equal to the original",
Pane@"square:",
Pane@" "
,
Manipulate[
Graphics[
{
{EdgeForm[Yellow],Opacity[0.5,Yellow],Polygon[{a[θ],b[θ],c[θ]}]},
{EdgeForm[Red],Opacity[0.5,Red],Polygon[{b[θ],d[θ],e[θ],c[θ]}]},
{EdgeForm[Green],Opacity[0.5,Green],Polygon[{a[θ],g[θ],f[θ],c[θ]}]},
{EdgeForm[Blue],Opacity[0.5,Blue],Polygon[{a[θ],h[θ],i[θ],b[θ]}]},
{Opacity[0.5,Black],Line[{c[θ],k[θ]}]},
{EdgeForm[Red],Opacity[0.5,Red],Polygon[{b[θ],dPrime[θ,s],ePrime[θ,s],cPrime[θ,s]}]},
{EdgeForm[Green],Opacity[0.5,Green],Polygon[{a[θ],gPrime[θ,t],fPrime[θ,t],CPrime[θ,t]}]}
},
ImageSize->{400,400}
],
{{θ,π/3},0,π/2},{s,0,3},{t,0,3},
SaveDefinitions->True,
Bookmarks->{
"STEP 0":>{s=0,t=0,θ=π/3},
"STEP 1":>{s=1,t=0,θ=π/3},
"STEP 2":>{s=2,t=0,θ=π/3},
"STEP 3":>{s=3,t=0,θ=π/3},
"STEP 4":>{s=3,t=1,θ=π/3},
"STEP 5":>{s=3,t=2,θ=π/3},
"STEP 6":>{s=3,t=3,θ=π/3}
}
]


}],

Initialization:>(
SetOptions[EvaluationNotebook[],PrivateNotebookOptions->{"PluginToolbarEnabled"->False},DockedCells->Cell[BoxData[ToBoxes[Row[{Column[{Image[,ImageSize->125],"Prof. Kelso"},ItemSize->{20,Automatic}],Column[{"Magnify",PopupMenu[Dynamic[CurrentValue[EvaluationNotebook[],"Magnification"]],Range[0.5,3,0.5]]}],"           ",Image[,ImageSize->90]},Spacer[5]]]],"DockedCell"]];

)


]

f[]

DEPLOY

CDFDeploy[ToFileName[{$UserDocumentsDirectory},"Olympic_Pythagorean_Theorem.cdf"],f[],
"Method"->"Standalone"];