# # Chapter 14. More Graphics # # # 14.1 The plottools package # # # # MAPLE SESSION 1 # > with(plottools); # # 14.1.1 Two-dimensional plot objects # # # # MAPLE SESSION 2 # > with(plottools): > qc := arc([0,0],1,Pi/2..Pi): > plots[display](qc, scaling=constrained); # # # MAPLE SESSION 3 # > with(plottools): > circle([1,0],1): > plots[display](%, scaling=constrained); # # # MAPLE SESSION 4 # > with(plottools): > pts := [[0, 0], [.93, .80], [1.2, .95], [1.6, 1.], > [.31, .30], [.62, .60]] : > curve(pts): > plots[display](%); # # # MAPLE SESSION 5 # > with(plottools): > disk_seq := seq(disk([cos(t*Pi/10),sin(t*Pi/10)],t/30, > color=COLOR(RGB,t/5,0,0)),t=1..5): > plots[display](disk_seq, scaling=constrained); # # # MAPLE SESSION 6 # > with(plottools): > hyperbola([2,1], 1, 1, -3..3): > plots[display](%); # # # MAPLE SESSION 7 # > with(plottools): > ellipse([2,1], 1, 2, filled=true, color=pink): > plots[display](%, scaling=constrained); # # # MAPLE SESSION 8 # > with(plottools): > ellipticArc([0,1], 2, 1, 0..Pi/3,filled=true, > color=turquoise): > plots[display](%,scaling=constrained); # # # MAPLE SESSION 9 # > with(plottools): > line([3,1],[1,4]): > plots[display](%); # # # MAPLE SESSION 10 # > with(plottools): > pie := pieslice([0,0],1,Pi/6..Pi/3,color=khaki): > plots[display](%,scaling=constrained); # # # MAPLE SESSION 11 # > with(plottools): > p:=point([2,3]): > plots[display](p); # # # MAPLE SESSION 12 # > with(plottools): > polyg := polygon([[0,0],[1,2],[1,1]]); > plots[display](polyg); # # # MAPLE SESSION 13 # > with(plottools): > pt := t -> [cos(t),sin(t)]: > pts := [seq(pt(2*Pi*k/5+Pi/10),k=0..4)]: > pentagon := polygon(pts, color=coral): > plots[display](pentagon,axes=none,scaling=constrained); # # # MAPLE SESSION 14 # > with(plottools): > polyg := rectangle([0,0],[1,2]); > plots[display](polyg, color=blue, scaling=constrained); # # 14.1.2 Three-dimensional plot objects # # # # MAPLE SESSION 15 # > with(plottools): > cone1 := cone([0,0,0],1,2): > plots[display](cone1, color=wheat, scaling=constrained, > orientation=[50,75]); # # # MAPLE SESSION 16 # > with(plottools): > cube := cuboid([0,0,0],[1,1,1],color=black): > plots[display](cube,scaling=constrained,axes=boxed, > style=wireframe,thickness=3,orientation=[40,75]); # # # MAPLE SESSION 17 # > with(plottools): > c := cylinder([0,0,0], 3,6): > plots[display](c, scaling=constrained,orientation=[50,75]); # # # MAPLE SESSION 18 # > cyl := t -> cylinder([cos(t),sin(t),0],0.2,t): > cylseq := seq(cyl(2*Pi*k/10),k=1..10): > plots[display](cylseq); # # # MAPLE SESSION 19 # > with(plottools): > dd :=dodecahedron([0,0,0],1): > plots[display](dd,scaling=constrained); # # # MAPLE SESSION 20 # > with(plottools): > hs := hemisphere([0,0,0],12): > plots[display](hs, scaling=constrained, axes=boxed, > orientation=[40,70]); # # # MAPLE SESSION 21 # > with(plottools): > hex1 := hexahedron([0,0,0],1,color=green): > plots[display](hex1,scaling=constrained,axes=boxed); > cub1 := cuboid([1,1,-1],[-1,-1,1],color=red): > plots[display](cub1,scaling=constrained,axes=boxed); # # # MAPLE SESSION 22 # > with(plottools): > ic :=icosahedron([0,0,0],1): > plots[display](ic,scaling=constrained); # # # MAPLE SESSION 23 # > with(plottools): > oc := octahedron([0,0,0],1,color=black,thickness=3): > plots[display](oc,style=wireframe,scaling=constrained, > orientation=[30,75]); # # # MAPLE SESSION 24 # > with(plottools): > qtor := semitorus([0,0,0], Pi..3*Pi/2, 1, 4): > circ := plots[spacecurve]([4*cos(t),4*sin(t),0],t=0..2*Pi, > color=black,thickness=3): > plots[display](qtor, circ,scaling=constrained, style=patch, > axes=boxed,orientation=[50,75]); # # # MAPLE SESSION 25 # > with(plottools): > sph := sphere([0,0,0],1): > plots[display](sph,scaling=constrained,orientation=[30,60]); # # # MAPLE SESSION 26 # > with(plottools): > tet := tetrahedron([0,0,0],1): > plots[display](tet,scaling=constrained,orientation=[80,80]); # # # MAPLE SESSION 27 # > with(plottools): > tor := torus([0,0,0], 1, 4): > plots[display](tor, scaling=constrained, style=patch, > axes=boxed,orientation=[50,75]); # # 14.1.3 Transformation of plots # # # # MAPLE SESSION 28 # > with(plottools): > tet:=tetrahedron([0,0,0],1): > plots[display](cutin(tet,2/3),orientation=[70,75]); # # # MAPLE SESSION 29 # > with(plottools): > tet:=tetrahedron([0,0,0],1): > plots[display](cutout(tet,1/3),orientation=[85,75]); # # # MAPLE SESSION 30 # > with(plottools): > ico := icosahedron(): > stel_ico:=stellate(ico,2): > scaled_dodec:=homothety(dodecahedron([0,0,0],1),1.75): > wf:=plots[display](scaled_dodec,scaling=constrained, > style=wireframe,color=black,thickness=3): > plots[display](wf,stel_ico,scaling=constrained); # # # MAPLE SESSION 31 # > with(plottools): > cn :=cone([0,0,0]): > pcn :=project(cn,[[0,0,0],[0,1,0],[1,0,0]]): > plots[display](cn,pcn); # # # MAPLE SESSION 32 # > cone1 :=cone([0,0,0]): > cone2 :=reflect(cone1,[[0,0,0],[0,1,0],[1,0,0]]): > plots[display](cone1,cone2,orientation=[45,75], > scaling=constrained); # # # MAPLE SESSION 33 # > with(plottools): > hyp := hyperbola([0,0],1,1,-2..2): > hyprot := rotate(hyp,Pi/20): > plots[display](hyp,hyprot); # # # MAPLE SESSION 34 # > with(plottools): > hyp := hyperbola([0,0],1,1,-2..2): > hypseq := seq(rotate(hyp,Pi*k/20),k=0..10): > plots[display](hypseq); # # # MAPLE SESSION 35 # > hypseq2:=seq(rotate(hyp,Pi*k/20,[1,0]),k=0..10): > plots[display](hypseq2); # # # MAPLE SESSION 36 # > with(plottools): > cone1 := cone([0,0,0],1,3): > yax := [[0,0,0],[0,1,0]]: > cone_seq := seq(rotate(cone1,2*Pi*k/10,yax),k=1..10): > plots[display](cone_seq,scaling=constrained, > orientation=[50,60]); # # # MAPLE SESSION 37 # > with(plottools): > cyl1:=cylinder([0,0,0],0.4,3): > yax:=[[0,0,0],[0,1,0]]: > cyl2:=scale(rotate(cyl1,Pi/5,yax),1/2,1/2,1/2): > plots[display](cyl1,cyl2,scaling=constrained,orientation= > [60,60]); # # # MAPLE SESSION 38 # > with(plottools): > stel_icosa := stellate(icosahedron([0,0,0],1),4): > plots[display](stel_icosa,scaling=constrained); # # # MAPLE SESSION 39 # > with(plottools): > plots[display](stellate(dodecahedron([0,0,0],1),3), > scaling=constrained); # # # MAPLE SESSION 40 # > with(plottools): > p:=plot3d([sin(x),cos(y),cos(x+y-1)],x=0..2*Pi,y=0..2*Pi): > F:=transform((x,y,z)->[x^2,y^2,z^2]): > plots[display](F(p)); # # # MAPLE SESSION 41 # > with(plottools): > line := plot(x,x=0..1): > line_seq:=seq(translate(line,cos(Pi*t/32),sin(Pi*t/32)), > t=0..16): > plots[display](line_seq,scaling=constrained); # # 14.2 The geometry package # # # # MAPLE SESSION 42 # > with(geometry): > point(C,0,0); # # # MAPLE SESSION 43 # > coordinates(C); # # # MAPLE SESSION 44 # > RegularPolygon(g,9,C,1); # # # MAPLE SESSION 45 # > detail(g); # # # MAPLE SESSION 46 # > draw(g,axes=none); # # # MAPLE SESSION 47 # > with(geometry): > RegularStarPolygon(sgon,17/7,point(o,0,0),1): > draw(sgon,axes=none); # # 14.3 The geom3d package # 14.3.1 Regular polyhedra # # # # MAPLE SESSION 48 # > with(geom3d): > GreatDodecahedron(gdh,point(O,0,0,0),1): > draw(gdh,orientation=[60,60]); # # # MAPLE SESSION 49 # > with(geom3d): > GreatIcosahedron(gih,point(O,0,0,0),1): > draw(gih,orientation=[75,65]); # # # MAPLE SESSION 50 # > with(geom3d): > GreatStellatedDodecahedron(gsdh,point(O,0,0,0),1): > draw(gsdh,orientation=[70,20]); # # # MAPLE SESSION 51 # > with(geom3d): > SmallStellatedDodecahedron(ssdh,point(O,0,0,0),1): > draw(ssdh); > draw(ssdh,orientation=[70,20]); # # # MAPLE SESSION 52 # > with(geom3d): > point(P1,0,0,0), point(P2,0,1,0): > point(P3,1,0,0), point(P4,0,1/2,1): > gtetrahedron(gt, [P1,P2,P3,P4]): > draw(gt); # # 14.3.2 Quasi-regular polyhedra # # # # MAPLE SESSION 53 # > with(geom3d): > cuboctahedron(coh,point(O,0,0,0),1): > draw(coh,orientation=[40,25]); # # # MAPLE SESSION 54 # > with(geom3d): > icosidodecahedron(idh,point(O,0,0,0),1): > draw(idh,orientation=[80,20]); # # 14.3.3 The Archimedean solids # # # # MAPLE SESSION 55 # > with(geom3d): > TruncatedIcosidodecahedron(tid,point(P,0,0,0),1): > draw(tid); # # # MAPLE SESSION 56 # > SmallRhombicuboctahedron(srco,point(P,0,0,0),1): > draw(srco); # # # MAPLE SESSION 57 # > TruncatedIcosahedron(tic,point(P,0,0,0),1): > draw(tic); # # # MAPLE SESSION 58 # > archset:={GreatRhombicuboctahedron, > GreatRhombiicosidodecahedron, > SmallRhombicuboctahedron, SmallRhombiicosidodecahedron, > SnubCube, SnubDodecahedron, TruncatedCuboctahedron, > TruncatedDodecahedron, TruncatedHexahedron, > TruncatedIcosahedron, TruncatedIcosidodecahedron, > TruncatedOctahedron, TruncatedTetrahedron}; > with(geom3d): > for a in archset do > printf("___________________________________________________________\n"); > a(gon,point(P,0,0,0),1): > printf(cat(convert(a,string),"\n")); > draw(gon); > end do; # # # MAPLE SESSION 59 # > with(geom3d): > TrapezoidalHexecontahedron(thc,point(P,0,0,0),1): > draw(thc); # # # MAPLE SESSION 60 # > HexakisOctahedron(hoc,point(P,0,0,0),1): > draw(hoc); # # # MAPLE SESSION 61 # > TrapezoidalIcositetrahedron(tict,point(P,0,0,0),1): > draw(tict);