Pythagorean Theorem

Manipulate[Labeled[Graphics[{RGBColor[1,.95,.75],Polygon[{{0,0},{a,0},{a,b}}],Thickness[.01],PointSize[.02],RGBColor[.67,.75,.15],Line[{{0,0},{a,b}}],Point[Table[k/Sqrt[a^2+b^2]{a,b},{k,0,Floor[Sqrt[a^2+b^2]]}]],RGBColor[1,.26,0],Line[{{0,0},{a,0}}],Point[Table[{i,0},{i,0,a}]],RGBColor[.12,.61,.78],Line[{{a,0},{a,b}}],Point[Table[{a,j},{j,0,b}]],Black,Thickness[.005],Inset[Graphics@Line[{{0,0},{0,.8},{.8,.8}}],{a,0},{.8,0},{.5,.5}],Text[Style["a = "<>ToString[NumberForm[N[a],{4,2},NumberPadding->{"","0"}]],12],{a/2,-.75}],Text[Style["b = "<>ToString[NumberForm[N[b],{4,2},NumberPadding->{"","0"}]],12],{a+.5,b/2},{-1,0}],Text[Style["c = "<>ToString[NumberForm[N[Sqrt[a^2+b^2]],{5,2},NumberPadding->{"","0"}]],12],{a/2-.5,b/2+.5},{1,0}]},ImageSize->{478,335},Axes->False,PlotRange->{{-5,15},{-2,10.5}},AspectRatio->Automatic],TraditionalForm@Text@Style[Grid[{{"(a^2)","+","(b^2)","=","(c^2)"},{Superscript[NumberForm[a,{4,2},NumberPadding->{" ","0"}],2],"+",Superscript[NumberForm[b,{4,2},NumberPadding->{" ","0"}],2],"=",Superscript[NumberForm[N[Sqrt[a^2+b^2]],{5,2},NumberPadding->{" ","0"}],2]},{NumberForm[a^2,{4,2},NumberPadding->{" ","0"}],"+",NumberForm[b^2,{4,2},NumberPadding->{" ","0"}],"=",NumberForm[N[a^2+b^2],{5,2},NumberPadding->{"  ","0"}]}},Alignment->{Right,Baseline},ItemSize->{{5,2.2,4.5,2.2,6},1.5}],12],Top],{{a,8,"a"},.01,10},{{b,8,"b"},.01,10}]

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Pythagorean Theorem" from The Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/PythagoreanTheorem/

Contributed by: Jeff Bryant

A full-function Wolfram Mathematica 6 system is required to edit or run this notebook.
(Mathematica Player runs only Demonstrations published on this site.)
GET WOLFRAM MATHEMATICA 6 »

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »