{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 } 1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "M aple Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 1 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "File: depart\\math\\maple \\misc\\shadein.mws Date: 9-dec-1999" }}}{EXCHG {PARA 18 "" 0 "" {TEXT -1 37 "Shading the region between two graphs" }}{PARA 19 "" 0 " " {TEXT -1 44 "by Tim Feeman [timothy.feeman@villanova.edu]" }}{PARA 0 "" 0 "" {TEXT -1 61 "[with collaborative hints from bob jantzen and \+ klaus volpert]" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "with(plot s): with(plottools):\n" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the na me changecoords has been redefined\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "The following procedure " }{TEXT 257 7 "shadein" }{TEXT -1 349 " is designed to shade in the region between two curves over a specifi ed interval. The inputs for the procedure are: the two functions (defi ned as procedures, not expressions), the desired interval on the x-axi s (e.g., between their intersection points if desired, but any interva l will work), and the color you want for the shading. \n\nYou must use " }{MPLTEXT 0 21 17 "with(plottools): " }{TEXT -1 38 "to use this pr ocedure. If you wish to " }{TEXT 256 7 "display" }{TEXT -1 52 " it tog ether with the original curves, you must use " }{MPLTEXT 0 21 11 "with (plot):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 54 "This procedure was created by analyzing the plottools " }{TEXT 258 7 "ellipse" }{TEXT -1 90 " command. It creates an upward sawtooth \+ sequence of shaded triangles from the lower curve " }{XPPEDIT 18 0 "f; " "6#%\"fG" }{TEXT -1 20 " to the upper curve " }{XPPEDIT 18 0 "g;" "6 #%\"gG" }{TEXT -1 168 " (if they are in this relation) , and then comp letes the shading with the complementary downward sawtooth sequence of triangles from the upper curve to the lower curve." }}{PARA 0 "" 0 " " {TEXT -1 2 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 884 "shadei n:=proc (f,g,a,c) \n local i, n, loptions; \n loptions := [args[5 . . nargs]]; \n if not hasoption(loptions,'numpoints','n','loptions') \+ \n then n := 50 \n fi; \n### WARNING: persistent store makes one-a rgument readlib obsolete\n loptions := convert(readli b(`plottools/local_2d`)(loptions),\n 'PLOToptions');\nseq(polygon ([\n[evalf(a[1]+(a[2]-a[1])*i/n),\n evalf(f(a[1]+(a[2]-a[1])*i/n))],\n [evalf(a[1]+(a[2]-a[1])*(i+1)/n),\n evalf(f(a[1]+(a[2]-a[1])*(i+1)/n)) ],\n[evalf(a[1]+(a[2]-a[1])*(i+1)/n),\n evalf(g(a[1]+(a[2]-a[1])*(i+1) /n))]],\ncolor=c,style=patchnogrid,op(loptions)),i = 0 .. n-1), seq(po lygon([[\nevalf(a[1]+(a[2]-a[1])*i/n),\nevalf(g(a[1]+(a[2]-a[1])*i/n)) ],\n[evalf(a[1]+(a[2]-a[1])*(i+1)/n),\nevalf(g(a[1]+(a[2]-a[1])*(i+1)/ n))],\n[evalf(a[1]+(a[2]-a[1])*i/n),\nevalf(f(a[1]+(a[2]-a[1])*i/n))]] ,\ncolor=c,style=patchnogrid,op(loptions)),i = 0 .. n-1) \nend;" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#>%(shadeinGR6&%\"fG%\"gG%\"aG%\"cG6%% \"iG%\"nG%)loptionsG6\"F/C&>8&7#&9\"6#;\"\"&9#@$4-%*hasoptionG6&F2.%*n umpointsG.8%.F2>FB\"#]>F2-%(convertG6$--%(readlibG6#%3plottools/local_ 2dG6#F2.%,PLOToptionsG6$-%$seqG6$-%(polygonG6&7%7$-%&evalfG6#,&&9&6#\" \"\"F\\o*&*&,&&Fjn6#\"\"#F\\oFin!\"\"F\\o8$F\\oF\\oFBFcoF\\o-Ffn6#-9$F gn7$-Ffn6#,&FinF\\o*&*&F_oF\\o,&FdoF\\oF\\oF\\oF\\oF\\oFBFcoF\\o-Ffn6# -FhoF[p7$Fjo-Ffn6#-9%F[p/%&colorG9'/%&styleG%,patchnogridG-%#opGFO/Fdo ;\"\"!,&FBF\\oF\\oFco-FT6$-FW6&7%7$Fen-Ffn6#-FgpFgnFcpFZFhpF[qF^qF`qF/ F/F/" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 105 "p:=plot(\{sin(x),c os(x)\},x=0..Pi/2,color=black):\ndisplay(\{p,shadein(sin,cos,[0,Pi/4], gray,numpoints=20)\});" }}{PARA 13 "" 1 "" {GLPLOT2D 400 300 300 {PLOTDATA 2 "6N-%)POLYGONSG6%7%7$$\"+3`=$G'!#5$\"+CD&y(eF*7$$\"+!R%)en 'F*$\"+%\\R4>'F*7$F.$\"+3$pJ&yF*-%&STYLEG6#%,PATCHNOGRIDG-%'COLOURG6&% $RGBG$\")=THv!\")F=F=-F$6%7%F-7$$\"+sMeoqF*$\"+%[![%\\'F*7$FD$\"+b'fSg (F*F5F9-F$6%7%7$$\"+=3*p#R!#6$\"+i.H#***F*7$$\"+N;)R&yFQ$\"+PL
F*$\"+/G&y!)*F*7$Fjp$\"+^YMk:F*F5F9-F$6%7%7$$\"+sN*)[FF*$\"+lBbC'*F*
7$$\"+aEfTJF*$\"+j^c5&*F*7$Ffr$\"+*\\/Wr#F*F5F9-F$6%7%7$$\"+!\\%>cBF*$
\"+/#*pB(*F*Fer7$Ffs$\"+QOXMBF*F5F9-F$6%7%FjqFes7$F[r$\"+@K!4&>F*F5F9-
F$6%7%7$$FPF*$\"+D`zQ#*F*7$$\"+**)*o>VF*$\"+Q cBF*$
\"+/#*pB(*F*7$F\\q$\"+@K!4&>F*F5FN-F$6%7%FcsFg`mF^clF5FN-F$6%7%F2F[rF-
F5FN-F$6%7%F]`mFjnFVF5F9-F$6%7%Fbam7$F^am$\"+QOXMBF*F]amF5F9-F$6%7%F[r
Fe\\mFfqF5FN-F$6%7%F`qFbamF[qF5F9-F$6%7%FjnF`qFenF5F9-F$6%7%FKFarFFF5F
9-F$6%7%7$$\"+sN*)[FF*$\"+*\\/Wr#F*FKFAF5F9-F$6%7%FabmFccm7$Fdcm$\"+lB
bC'*F*F5F9-F$6%7%Fe\\mFa^mF`\\mF5FN-F$6%7%FarFepF[pF5F9-F$6%7%F`]mF[^m
F[]mF5F9-F$6%7%F\\sF`]mFgrF5F9-F$6%7%F]amF[dmFabmF5FN-F$6%7%FepF\\sF`p
F5F9-F$6%7%F\\_mF`oFi^mF5F9-F$6%7%F[^mF\\_mFf]mF5F9-F$6%7%Fg`mFa`mFh_m
F5FN-F$6%7%Fa`mFVF]`mF5FN-F$6%7%F[dmFAFccmF5FN-%+AXESLABELSG6$Q\"x6\"Q
!6\"-%%VIEWG6$;Fds$Fgn!\"*%(DEFAULTG" 1 2 0 1 10 0 2 9 1 4 2 1.000000
45.000000 45.000000 0 0 "Curve 1" "Curve 2" "Curve 3" "Curve 4" "Curve
5" "Curve 6" "Curve 7" "Curve 8" "Curve 9" "Curve 10" "Curve 11" "Cur
ve 12" "Curve 13" "Curve 14" "Curve 15" "Curve 16" "Curve 17" "Curve 1
8" "Curve 19" "Curve 20" "Curve 21" "Curve 22" "Curve 23" "Curve 24" "
Curve 25" "Curve 26" "Curve 27" "Curve 28" "Curve 29" "Curve 30" "Curv
e 31" "Curve 32" "Curve 33" "Curve 34" "Curve 35" "Curve 36" "Curve 37
" "Curve 38" "Curve 39" "Curve 40" "Curve 41" "Curve 42" }}}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "0 0 0" 0 }{VIEWOPTS 1
1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }