Polygon

Polygon[{p1,,pn}]

represents a filled polygon with points pi.

Polygon[{{p11,},{p21,},}]

represents a collection of polygons.

Details and Options

  • Polygon can be used as a geometric region and a graphics primitive.
  • Polygon is a plane region, representing all the points inside the closed curve with line segments {p1,p2}, , {pn-1,pn}, and {pn,p1}. A point is an element of the polygon if a ray from the point in any direction in the plane crosses the boundary curve an odd number of times.
  • As a geometric region, the points pi can have any length, but must all lie in a plane.
  • Polygon can be used in Graphics and Graphics3D.
  • Non-planar polygons are accepted in Graphics3D and are triangulated, but the result is not platform and view independent and may lead to surprising results.
  • In graphics, the points pi can be Scaled, Offset, ImageScaled, and Dynamic expressions.
  • Graphics renderings is affected by directives such as FaceForm, EdgeForm, Texture, Specularity, Opacity, and color.
  • FaceForm[front,back] can be used to specify different styles for the front and back of polygons in 3D. The front is defined by the right-hand rule and the direction of the first three points.
  • The following options and settings can be used in graphics:
  • VertexColorsAutomaticvertex colors to be interpolated
    VertexNormalsAutomaticeffective vertex normals for shading
    VertexTextureCoordinatesNonecoordinates for textures

Examples

open allclose all

Basic Examples  (7)

Triangles:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

CirclePoints gives the corner coordinates for a regular polygon:

In[1]:=
Click for copyable input
Out[1]=

Self-intersecting polygon:

In[1]:=
Click for copyable input
Out[1]=

Differently styled 2D polygons:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Differently styled 3D polygons:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Texture-mapped polygon:

In[1]:=
Click for copyable input
Out[1]=

Area:

In[1]:=
Click for copyable input
Out[1]=

Centroid:

In[2]:=
Click for copyable input
Out[2]=

Scope  (21)

Options  (6)

Applications  (3)

Properties & Relations  (4)

Possible Issues  (2)

Neat Examples  (3)

See Also

Triangle  Rectangle  CirclePoints  RegularPolygon  Cuboid  BSplineSurface  GraphicsComplex  Opacity  Specularity  Glow  Lighting  Disk  Line  RoundingRadius  Area  GeoArea

Tutorials

Introduced in 1988
(1.0)
| Updated in 2014
(10.0)