BUILT-IN MATHEMATICA SYMBOL

# Polygon

Polygon[{pt1, pt2, ...}]
is a graphics primitive that represents a filled polygon.

Polygon[{{pt11, pt12, ...}, {pt21, ...}, ...}]
represents a collection of polygons.

## Details and OptionsDetails and Options

• Polygon can be used in both Graphics and Graphics3D (two- and three-dimensional graphics).
• The positions of points can be specified either in ordinary coordinates as or , 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 a polygon is formed by joining the last point you specify to the first one.
• You can use graphics directives such as GrayLevel, RGBColor, and Opacity to specify how polygons should be filled. »
• FaceForm and EdgeForm can be used to specify how the interiors and boundaries of polygons should be rendered. »
• In two dimensions, polygons are by default rendered with no explicit edges drawn. In three dimensions, they are by default rendered with black lines on their edges.
• The option VertexColors->{c1, c2, ...} can be used to specify different colors for each vertex of a polygon. The interior is then colored by interpolation between these. »
• In three dimensions, shading of polygons is determined by simulated lighting.
• Polygons are by default assumed to act like diffuse gray reflectors. Color directives can be used to change their surface color.
• You can specify surface material properties using the graphics directives Specularity and Opacity.
• Glow[color] can be used to add glow colors that are not affected by simulated illumination.
• In three-dimensional graphics, polygons are considered to have both front and back faces, with their normals taken to point to the front.
• You can use FaceForm[front, back] to specify different properties for front and back faces. »
• By default, the normal direction for a polygon is determined by a right-hand rule, so that typically the first three vertices will be in a counterclockwise order when viewed from the front.
• The option VertexNormals->{n1, n2, ...} can be used to specify effective normals at each vertex of a polygon, to be interpolated for purposes of smooth shading. »
• Polygons in 2D and 3D can be non-convex, and can intersect themselves. Self-intersecting polygons are filled according to an even-odd rule that alternates between filling and not filling at each crossing.
• In 3D, non-planar polygons are broken into triangles for rendering. Quadrilaterals are broken in two; other convex polygons are typically broken into triangles emanating from the center.
• For purposes of shading, non-planar polygons are taken by default to have a single average normal.
• Individual coordinates and lists of coordinates in polygons can be Dynamic objects.

## ExamplesExamplesopen allclose all

### Basic Examples (5)Basic Examples (5)

Triangles:

 Out[1]=
 Out[2]=

Self-intersecting polygon:

 Out[1]=

Differently styled 2D polygons:

 Out[2]=

Differently styled 3D polygons:

 Out[2]=

Texture-mapped polygon:

 Out[1]=