{VERSION 1 0 "X11/Motif" "1.0"}{GLOBALS 3 1}{FONT 0 "-adobe-helve
tica-bold-r-normal--*-180-*-*-*-*-*-*" "helvetica" "Helvetica-Bol
d" 8 18 0 "Helvetica-Bold" 18}{FONT 1 "-adobe-new century schoolb
ook-bold-i-normal--*-180-*-*-*-*-*-*" "new century schoolbook" "T
imes-BoldItalic" 8 18 96 "Times-BoldItalic" 18}{FONT 2 "-adobe-co
urier-medium-r-normal--*-140-*" "courier" "Courier" 4 14 192 "Cou
rier" 12}{FONT 3 "-adobe-helvetica-bold-r-normal--*-240-*-*-*-*-*
-*" "helvetica" "Helvetica-Bold" 8 24 0 "Helvetica-Bold" 24}{FONT
 4 "-adobe-helvetica-bold-r-normal--*-240-*-*-*-*-*-*" "helvetica
" "Helvetica-Bold" 8 24 0 "Helvetica-Bold" 24}{FONT 5 "-adobe-hel
vetica-bold-r-normal--*-240-*-*-*-*-*-*" "helvetica" "Helvetica-B
old" 8 24 0 "Helvetica-BoldOblique" 24}{FONT 6 "-adobe-helvetica-
bold-r-normal--*-240-*-*-*-*-*-*" "helvetica" "Helvetica-Bold" 8 
24 0 "Helvetica-Bold" 24}{FONT 7 "-adobe-helvetica-bold-r-normal-
-*-140-*" "helvetica" "Helvetica-Bold" 8 14 0 "Helvetica-Bold" 14
}{SCP_R 1 0 135{COM_R 2 0{TEXT 1 59 "MAPLE WORKSHEET #1: 2d polyg
onplots and graphic primitives."}}{SEP_R 3 0}{COM_R 4 0{TEXT 1 23
 "Load the plots package:"}}{SEP_R 5 0}{INP_R 6 0 "> "{TEXT 0 12 
"with(plots):"}}{SEP_R 7 0}{COM_R 8 0{TEXT 1 50 "Define the verti
ces of a  regular n-sided polygon:"}}{SEP_R 9 0}{INP_R 10 0 "> "
{TEXT 0 84 "ngon := (a,b,r,n) -> \012[ seq([ a+r*cos(2*Pi*k/n), b
+r*sin(2*Pi*k/n) ], k = 0..n-1) ]:"}}{OUT_R 11 0 10{TEXT 2 42 "Wa
rning, `k` is implicitly declared local\012"}}{SEP_R 12 0}{INP_R 
13 0 "> "{TEXT 0 30 "ngon0 := n ->ngon(0, 0, 1, n):"}}{SEP_R 14 0
}{INP_R 15 0 "> "{TEXT 0 66 "polygonplot(ngon0(5),\012axes=none, \+
color=cyan, scaling=constrained);"}}{SEP_R 16 0}{INP_R 17 0 "> "
{TEXT 0 113 "polygonplot(ngon0(5),\012axes=none, color=cyan, scal
ing=constrained,\012titlefont=[COURIER,BOLD,22], title=`Pentagon`
);"}}{SEP_R 18 0}{INP_R 19 0 "> "{TEXT 0 136 "pent := polygonplot
(ngon0(5),\012axes=none, color=cyan, scaling=constrained,\012titl
efont=[COURIER,BOLD,22], title=`Pentagon`):\012display(pent);"}}
{SEP_R 20 0}{INP_R 21 0 "> "{TEXT 0 78 "tex := textplot([0,0,`Ins
ide a Pentagon`],\012font=[TIMES,ROMAN,38], color=blue):"}}{SEP_R
 22 0}{INP_R 23 0 "> "{TEXT 0 20 "display(\{pent,tex\});"}}{SEP_R
 24 0}{INP_R 25 0 "> "{TEXT 0 135 "wirepent := polygonplot(ngon0(
5),\012axes=none, color=red, scaling=constrained, \012style=line,
 thickness=5, linestyle=2):\012display(wirepent);"}}{SEP_R 26 0}
{INP_R 27 0 "> "{TEXT 0 32 "display(\{ pent, wirepent, tex\});"}}
{SEP_R 28 0}{COM_R 29 0{TEXT 1 60 "We create a figure for the pro
of of the Pythagorean Theorem:"}}{SEP_R 30 0}{INP_R 31 0 "> "
{TEXT 0 157 "pyt1 := polygonplot(\012[ [0,0],[1,2],[3,3],[3,0],[1
,0],[1,3],[0,3],[0,2],[3,2],[3,3],[1,3],[1,0],[0,0],[0,2] ],\012s
tyle=line, thickness=3, color=red, axes=none):"}}{SEP_R 32 0}
{INP_R 33 0 "> "{TEXT 0 133 "pyt2 := polygonplot(\012[ [4,0],[7,0
],[7,3],[4,3],[4,0],[5,0],[7,1],[6,3],[4,2],[5,0] ],\012style=lin
e, thickness=3, color=red, axes=none):"}}{SEP_R 34 0}{INP_R 35 0 
"> "{TEXT 0 85 "pyt3 := polygonplot(\012[ [1,0],[3,0],[3,2],[1,2]
,[1,0] ],\012color=aquamarine, axes=none):"}}{SEP_R 36 0}{INP_R 
37 0 "> "{TEXT 0 85 "pyt4 := polygonplot(\012[ [0,2],[1,2],[1,3],
[0,3],[0,2] ],\012color=aquamarine, axes=none):"}}{SEP_R 38 0}
{INP_R 39 0 "> "{TEXT 0 86 "pyt5 := polygonplot(\012[ [5,0],[7,1]
,[6,3],[4,2],[5,0] ], \012color=aquamarine, axes=none):"}}{SEP_R 
40 0}{INP_R 41 0 "> "{TEXT 0 136 "pyt6 := textplot(\012\{[0.5,-0.
15,`a`],[4.5,-0.15,`a`],[2,-0.15,`b`],[6,-0.15,`b`],[0.53,0.79,`c
`],[4.47,0.73,`c`]\},font=[COURIER,BOLD,18]):"}}{SEP_R 42 0}
{INP_R 43 0 "> "{TEXT 0 134 "display(\{pyt1,pyt2,pyt3,pyt4,pyt5,p
yt6\},\012scaling=constrained, \012titlefont=[COURIER,BOLD,18], t
itle=`Proof of the Pythagorean Theorem`);"}}{SEP_R 44 0}{COM_R 45
 0{TEXT 1 44 "A figure for determining the golden section:"}}
{SEP_R 46 0}{INP_R 47 0 "> "{TEXT 0 37 "P:=n->[sin(2*Pi*n/5), cos
(2*Pi*n/5)]:"}}{SEP_R 48 0}{COM_R 49 0{TEXT 1 69 "The line segmen
ts P(1)P(3) and P(2)P(4) intersect on the y-axis at Q:"}}{SEP_R 
50 0}{INP_R 51 0 "> "{TEXT 0 75 "slope := (P(1)[2]-P(3)[2])/(P(1)
[1]-P(3)[1]):\012Q:=[0,P(1)[2]-slope*P(1)[1]]:"}}{SEP_R 52 0}
{INP_R 53 0 "> "{TEXT 0 66 "penta := polygonplot([seq(P(n), n=0..
4)],\012color=red, thickness=4):"}}{SEP_R 54 0}{INP_R 55 0 "> "
{TEXT 0 66 "r1 := polygonplot(\012[ [P(1),Q],[P(4),Q] ],\012color
=red, thickness=4):"}}{SEP_R 56 0}{INP_R 57 0 "> "{TEXT 0 57 "r2 \+
:= polygonplot(\012[P(1),P(4)],\012color=gold, thickness=4):"}}
{SEP_R 58 0}{INP_R 59 0 "> "{TEXT 0 67 "r3 := polygonplot(\012[ [
P(2),Q],[P(3),Q] ],\012color=blue, thickness=4):"}}{SEP_R 60 0}
{INP_R 61 0 "> "{TEXT 0 193 "labels := textplot(\012\{ [0.5298,0.
7311,`1`], [-0.004567,0.3876,`golden section=g`],\012[-0.4439,-0.
1386,`1`], [0.3764,-0.5394,`1/g`], [-0.02436,-0.90176,`1`] \},\01
2font=[TIMES,ROMAN,22], color=yellow):"}}{SEP_R 62 0}{INP_R 63 0 
"> "{TEXT 0 141 "display(\{penta, r1, r2, r3, labels\},\012style=
line, axes=none, scaling=constrained,\012titlefont=[COURIER,BOLD,
22], title=`red=1,gold=g,blue=1/g`);"}}{SEP_R 64 0}{INP_R 65 0 ">
 "{TEXT 0 74 "r4:=polygonplot([ [P(1),Q,P(4)], [P(2),P(3),Q] ],\0
12style=patch,color=cyan):"}}{SEP_R 66 0}{INP_R 67 0 "> "{TEXT 0 
131 "display(\{penta, r1, r2, r3, r4, labels\},\012style=line, ax
es=none, scaling=constrained,\012titlefont=[COURIER,BOLD,22], tit
le=`1+1/g=g`);"}}{SEP_R 68 0}{INP_R 69 0 "> "{TEXT 0 102 "polygon
plot(ngon0(96),\012axes=none, color=red, scaling=constrained,\012
title=`A 96-sided regular polygon`);"}}{SEP_R 70 0}{INP_R 71 0 ">
 "{TEXT 0 115 "plot([cos(u), sin(u), u=0..2*Pi],\012numpoints=250
, thickness=2, scaling=constrained, \012color=yellow, tickmarks=[
0,0]);"}}{SEP_R 72 0}{INP_R 73 0 "> "{TEXT 0 211 "display(\012\{ \+
polygonplot(ngon0(96), color=red), \012plot([cos(u), sin(u), u=0.
.2*Pi], color=yellow, numpoints=500, thickness=2) \},\012view=[0.
7039..0.7124,0.7034..0.7109], thickness=2, \012axes=none, scaling
=constrained );"}}{SEP_R 74 0}{INP_R 75 0 "> "{TEXT 0 155 "symmax
 := (k,l)->polygonplot(\012[ [1.2*cos(2*k*Pi/l), 1.2*sin(2*k*Pi/l
)], [-1.2*cos(2*k*Pi/l), -1.2*sin(2*k*Pi/l)] ],\012thickness=2, s
tyle=line, color=yellow):"}}{SEP_R 76 0}{INP_R 77 0 "> "{TEXT 0 
183 "display(\012\{ polygonplot(ngon0(5), style=patch, color=red)
,\012seq(symmax(k,5), k=0..4) \},\012axes=none, scaling=constrain
ed,\012titlefont=[COURIER,BOLD,18], title=`Symmety axes of a pent
agon`);"}}{SEP_R 78 0}{INP_R 79 0 "> "{TEXT 0 185 "display(\012\{
 polygonplot(ngon0(96), style=patch, color=red),\012seq(symmax(k,
96), k=0..95) \},\012axes=none, scaling=constrained,\012titlefont
=[COURIER,BOLD,16], title=`Symmetry axes of a 96-gon`);"}}{SEP_R 
80 0}{COM_R 81 0{TEXT 1 17 "Hexagonal tiling:"}}{SEP_R 82 0}
{INP_R 83 0 "> "{TEXT 0 79 "hex := (a,b,c1,c2,c3)->polygonplot( \
012ngon(a,b,1,6),\012color=COLOR(RGB,c1,c2,c3)):"}}{SEP_R 84 0}
{INP_R 85 0 "> "{TEXT 0 185 "display(\012\{ hex(0,0,1,0,0),\012se
q( hex(sqrt(3)*cos(Pi/6+2*k*Pi/6), sqrt(3)*sin(Pi/6+2*k*Pi/6), \0
12evalf(sin(k/4)),evalf(cos(k/4)),evalf(sin(k/4))), k=1..6) \},\0
12axes=none,scaling=constrained);"}}{SEP_R 86 0}{COM_R 87 0{TEXT 
1 29 " Predefined colors in Maple: "}}{SEP_R 88 0}{INP_R 89 0 "> \+
"{TEXT 0 226 "col:=[aquamarine,black,blue,navy,coral,cyan,brown,g
old,green,gray,grey,khaki,magenta,maroon,orange,pink,plum,red,sie
nna,tan,turquoise,violet,wheat,white,yellow]:\012text := (x0,y0,a
)->textplot([x0,y0,`a`], font=[TIMES,ROMAN,18]):"}}{SEP_R 90 0}
{INP_R 91 0 "> "{TEXT 0 260 "display(\012\{ seq( polygonplot(\012
[ [0,0],[cos(2*k*Pi/25),sin(2*k*Pi/25)],[cos(2*(k+1)*Pi/25),sin(2
*(k+1)*Pi/25)] ],\012color=col[k]), k=1..25),\012seq( text(2*cos(
2*k*Pi/25),2*sin(2*k*Pi/25), col[k]),k=1..25) \},\012axes=none, s
caling=constrained,\012title=`Colored Piechart`);"}}{SEP_R 92 0}
{COM_R 93 0{TEXT 1 66 "The next graphics is an illustration for t
he Lunes of Hyppocrates."}}{SEP_R 94 0}{INP_R 95 0 "> "{TEXT 0 63
 "hyp1 := plot([cos(t),sin(t),t=0..Pi], \012thickness=3, color=re
d):"}}{SEP_R 96 0}{INP_R 97 0 "> "{TEXT 0 69 "hyp2 := plot([cos(t
),sin(t),t=Pi..2*Pi], \012thickness=3, color=yellow):"}}{SEP_R 98
 0}{INP_R 99 0 "> "{TEXT 0 89 "hyp3 := plot([sqrt(2)*cos(t), sqrt
(2)*sin(t)-1, t=Pi/4..3*Pi/4],\012thickness=3, color=red):"}}
{SEP_R 100 0}{INP_R 101 0 "> "{TEXT 0 131 "hyp4 := polygonplot(\0
12[ [-1,0],[1,0],[0,-1],[-1,0] ],\012thickness=3, color=COLOR(RGB
, 0.1960, 0.6000, 0.8000),\012style=line, axes=none):"}}{SEP_R 
102 0}{INP_R 103 0 "> "{TEXT 0 89 "hyp5 := plot([sqrt(2)*cos(t), \+
sqrt(2)*sin(t)-1, t=Pi/4..3*Pi/4],\012thickness=3, color=red):"}}
{SEP_R 104 0}{INP_R 105 0 "> "{TEXT 0 106 "hyp5 := polygonplot(\0
12[ [-1,0],[0,1],[1,0],[0,1],[-1,0] ],\012thickness=3, color=pink
, axes=none, style=line):"}}{SEP_R 106 0}{INP_R 107 0 "> "{TEXT 0
 200 "hyp6:=textplot([0,0.69,`A`],color=red):\012hyp7:=textplot([
0,-0.44,`A`],color=COLOR(RGB, 0.1960, 0.6000, 0.8000)):\012hyp8 :
= textplot(\{ [-0.5926,0.6038,`B`], [0.5926,0.6038,`B`],\012[-0.0
048,0.1825,`2B`] \} ):"}}{SEP_R 108 0}{INP_R 109 0 "> "{TEXT 0 
129 "display(\{hyp1,hyp2,hyp3,hyp4,hyp6,hyp7\},\012font=[TIMES,RO
MAN,24], scaling=constrained, axes=none,\012title=`The Lune of Hy
ppocrates`);"}}{SEP_R 110 0}{INP_R 111 0 "> "{TEXT 0 130 "display
(\{hyp1,hyp2,hyp3,hyp4,hyp5,hyp8\},\012font=[TIMES,ROMAN,24], sca
ling=constrained, axes=none,\012title=`The Lunes of Hyppocrates`)
;"}}{SEP_R 112 0}{COM_R 113 0{TEXT 1 13 "Colored disk:"}}{SEP_R 
114 0}{INP_R 115 0 "> "{TEXT 0 115 "coldisk := (a,b,r,c1,c2,c3)->
\012display(polygonplot(ngon(a,b,r,50)),\012scaling=constrained, \+
color=COLOR(RGB,c1,c2,c3)):"}}{SEP_R 116 0}{INP_R 117 0 "> "{TEXT
 0 38 "disk := (a,b,r)->coldisk(a,b,r,1,1,1):"}}{SEP_R 118 0}
{INP_R 119 0 "> "{TEXT 0 156 "display(\012\{ seq(coldisk(cos(2*k*
Pi/25),sin(2*k*Pi/25),0.05,\012evalf(cos(k/20)),evalf(sin(k/20)),
evalf(sin(k/20))), k=1..25) \},\012axes=none, scaling=constrained
);"}}{SEP_R 120 0}{COM_R 121 0{TEXT 1 16 "Colored vectors:"}}
{SEP_R 122 0}{INP_R 123 0 "> "{TEXT 0 418 "colvec := (a,b,r,theta
,c1,c2,c3)->display(\012\{ polygonplot( \012[ [a, b], [a+0.95*r*c
os(theta), b+0.95*r*sin(theta)] ],\012style=line, thickness=3),\0
12polygonplot(\012[ [a+r*cos(theta),b+r*sin(theta)], \012  [a+r*c
os(theta)-0.15*r*cos(theta-Pi/12),\012   b+r*sin(theta)-0.15*r*si
n(theta-Pi/12)],\012  [a+r*cos(theta)-0.15*r*cos(theta+Pi/12),\01
2   b+r*sin(theta)-0.15*r*sin(theta+Pi/12)] ]) \},\012scaling=con
strained, color=COLOR(RGB,c1,c2,c3) ):"}}{SEP_R 124 0}{INP_R 125 
0 "> "{TEXT 0 48 "vec := (a,b,r,theta)->colvec(a,b,r,theta,1,1,1)
:"}}{SEP_R 126 0}{INP_R 127 0 "> "{TEXT 0 60 "colvec0 := (r,theta
,c1,c2,c3)->colvec(0,0,r,theta,c1,c2,c3):"}}{SEP_R 128 0}{INP_R 
129 0 "> "{TEXT 0 36 "vec0 := (r,theta)->vec(0,0,r,theta):"}}
{SEP_R 130 0}{INP_R 131 0 "> "{TEXT 0 71 "vec1 := display( [seq(c
olvec0(sqrt(3),Pi/6+2*Pi*k/6,1,0,1), k=0..5)] ):"}}{SEP_R 132 0}
{INP_R 133 0 "> "{TEXT 0 60 "vec2 := display( [seq(colvec0(1,2*Pi
*k/6,0,1,1), k=0..6)] ):"}}{SEP_R 134 0}{INP_R 135 0 "> "{TEXT 0 
111 "display(\{vec1,vec2\},\012scaling=constrained, axes=none,\01
2titlefont=[COURIER,BOLD,16], title=`Vector Figure of G2`);"}}
{SEP_R 136 0}}{END}
