This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Graphics and Sound / Graphics Primitives  /

  • Polygon[ , , ... ] is a graphics primitive that represents a filled polygon.
  • Polygon can be used in both Graphics and Graphics3D (two- and three-dimensional graphics).
  • The positions of points can be specified either in absolute coordinates as x , y or x , y , z , or in scaled coordinates as Scaled[ x , y ] or Scaled[ x , y , z ].
  • Offset can be used to specify coordinates in two dimensions.
  • The boundary of the polygon is formed by joining the last point you specify to the first one.
  • In two dimensions, self-intersecting polygons are allowed.
  • In three dimensions, planar polygons that do not intersect themselves will be drawn exactly as you specify them. Other polygons will be broken into triangles.
  • You can use graphics directives such as GrayLevel and RGBColor to specify how polygons should be filled.
  • In three dimensions, the shading can be produced from simulated illumination.
  • In three-dimensional graphics, polygons are considered to have both a front and a back face. The sense of a polygon is defined in terms of its first three vertices. When taken in order, these vertices go in a counterclockwise direction when viewed from the front. (The frontward normal is thus obtained from a right-hand rule.)
  • You can use FaceForm to specify colors for the front and back faces of polygons.
  • In three-dimensional graphics, edges of polygons are shown as lines, with forms specified by the graphics directive EdgeForm.
  • See the Mathematica book: Section 2.9.1, Section 2.9.2Section 2.9.8.
  • See also: Raster, Rectangle, Cuboid, SurfaceColor.
  • Related package: Geometry`Polytopes`, Graphics`Polyhedra`.

    Further Examples

    This displays a few superimposed copies of a random pentagon.

    Evaluate the cell to see the graphic.