1.15.  Examples of graphics with primitives

(* Broken line in the plane defined by the boundary points of its segments *)  linia1 = Line[& ... , 3}, {-1, 5}, {2, 2} } ] ; <br /> g2 = Show[Graphics[linia1]]   <br /> Show[ g2, Axes -> True]

[Graphics:../HTMLFiles/index_93.gif]

[Graphics:../HTMLFiles/index_94.gif]

  (* Rectangle defined by its dots *)  rec = Graphics[   {Rectangle[{1, -1}, {2, -0.3}] }   ] ; <br /> g3 = Show[rec, AspectRatio -> 1]

[Graphics:../HTMLFiles/index_96.gif]

 (* Polygon for n = 5 (pentagon) *)  pet1 = Table[{Sin[2 π * n/5.],    Cos[2 π * n/5.] } , {n, 5}] ; <br /> d5 = Graphics[Polygon[pet1]] ;  Show[d5, AspectRatio -> 1]

[Graphics:../HTMLFiles/index_98.gif]

 (* Displayng the three primitives in the same graphics *)  Show[g2, rec, d5, AspectRatio -> Automatic]

[Graphics:../HTMLFiles/index_100.gif]

 (* Polygon for n = 11 *)  pet2 = Table[{Sin[2 π * n/11.],    Cos[2 π * n/11.] } , {n, 11}] ; <br /> Show[Graphics[Polygon[pet2]], AspectRatio -> Automatic]

[Graphics:../HTMLFiles/index_102.gif]

 (* Circle defined by the center in {1, 6} and radius 4 *)  (* The default ratio of y/x in Mathematica is the GoldenRatio = 0.618 *)  s1 = Graphics[Circle[ {1, 6} , 4 ]] ; <br /> Show[s1]

[Graphics:../HTMLFiles/index_104.gif]

 (* Disk defined by the co - ordinates of its center and radius *)  s2 = Graphics[ Disk[   {2, 7}, 4 ]] ; <br /> Show[s2]

[Graphics:../HTMLFiles/index_106.gif]

  (* Combined graphics of the upper circle and the disk at ratio y/x = 1 *)  Show[s1, s2, AspectRatio -> 1]

[Graphics:../HTMLFiles/index_108.gif]

 (* Broken line in the 3 D space defined by its vertices *)  points = { {1, 0, 2}, {5, 7, -1}, {-2, -3, -4}, {1, 4, 9}} ;  k1 = Line[ points ] ; <br /> g6 = Show[Graphics3D[ k1]]

[Graphics:../HTMLFiles/index_110.gif]

 (* 3 D polygon of the previous example *)  poli = Polygon[   points] ; <br /> g7 = Show[Graphics3D[poli]]

[Graphics:../HTMLFiles/index_112.gif]

 (* Graphics of a parallelipiped defined by two opposite vertices *)  cu1 = Cuboid[{0, -2, 3}, {3, 4, 5}] <br /> g8 = Show[Graphics3D[cu1]]

[Graphics:../HTMLFiles/index_114.gif]

  (* Combined graphics of the polygon and parallelipiped *)  (* The last graphics show the same from a different view point *)  Show[g7, g8]  Show[%, ViewPoint -> {3, -2, 2} ]

[Graphics:../HTMLFiles/index_116.gif]

[Graphics:../HTMLFiles/index_117.gif]