{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "with(Maplets): with(Maplets[Tools]) : with(Maplets[Elements]): with(plots):\nStartEngine();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1054 "PythagPrac:=Maplet(onstartup = Ru nWindow(MAIN),\n Window[MAIN]('title'=\"Pythagorean Practice\",\n \+ [ [ Button(\"New Triangle\", Evaluate('function'=\"newtriangle\")),\n \+ Button(\"Hint\", RunWindow(HINT)),\n Button(\"Quit\", Sh utdown())\n ],\n [ [ [ \"If a=\", TextField['funca']('widt h'=5, editable=false)],\n [ \"and b=\", TextField['funcb'](' width'=5, editable=false)],\n [ \"find c=\", TextField['funcc ']('width'=5, background=turquoise)]\n ],\n [ Plotter['m yplot']('width'=200, 'height'=200)\n ]\n ],\n [ Butto n(\"Check\", Evaluate('function' = \"checkans\")),\n Button(\"S how\", Evaluate('function' = \"showans\"))\n ],\n [ \"Reply: \", TextField['replybox']('width'=25)\n ],\n [ \"Created by: Eleanor Hobaugh and Carolyn Davidson Copyright P. Yasskin 2005\"\n \+ ]\n ]\n ),\n Window[HINT]('title'=\"Pythagorean Practice, Hi nt\",\n [ [ HorizontalGlue(),\n Button(\"Quit\", CloseWindow (HINT))\n ],\n [ MathMLViewer(value=MathML[Export](c=sqrt(a^ 2+b^2)))\n ]\n ]\n )\n):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 264 "pts:=[ \n[1,sqrt(3),2], [sqrt(3),1,2],\n[3,4,5], [4,3,5],\n[6,8,10], [8,6,10] ,\n[5,12,13], [12,5,13],\n[10,24,26], [24,10,26],\n[9,12,15], [12,9,15 ],\n[12,16,20], [16,12,20],\n[25,60,65], [60,25,65],\n[20,48,52], [48, 20,52],\n[15,36,39], [36,15,39],\n[15,20,25], [20,15,25]\n];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "randpts:=rand(1..nops(pts)): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 551 "newtriangle:=proc()\nlocal p1,p2,p3,p4;\nglob al a,b,c, pts, randpts;\na,b,c:=op(pts[randpts()]);\nSet(funca=a);\nSe t(funcb=b);\nSet(funcc=\"\");\np1:=plot([[0,0],[a,b],[a,0],[0,0]], sca ling=constrained, thickness=4, tickmarks=[[0,evalf[3](a)],[0,evalf[3]( b)]], view=[0..a+1,0..b+1]);\np2:=textplot([a/2,0,\"a\"],align=BELOW, \+ font=[TIMES,BOLDITALIC,14]);\np3:=textplot([a,b/2,\" b\"],align=RIGHT, font=[TIMES,BOLDITALIC,14]);\np4:=textplot([a/2,b/2,\"c \"],align=\{A BOVE,LEFT\}, font=[TIMES,BOLDITALIC,14]);\nSet('myplot'=display(p1,p2, p3,p4));\nSet(replybox=\" \");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 229 "checkans:=proc()\nlocal userc;\nglobal c;\nuserc:= Get('funcc'::integer, corrections=true, update=true);\nif userc=c then \nSet(replybox=\"Great job! You are correct.\");\nelse\nSet(replybox= \"Read the Hint and try again.\");\nend if\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "showans:=proc()\nglobal c;\nSet(fun cc=c);\nSet(replybox=\"Try doing it yourself.\");\nend proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Display( PythagPrac );" }}}} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }