Polygon

Polygon[{p1,,pn}]

represents a filled polygon with points pi.

Polygon[{p1,,pn}{{q1,,qm},}]

represents a polygon with holes {q1,,qm},.

Polygon[{poly1,poly2,}]

represents a collection of polygons polyi.

Polygon[{p1,,pn},data]

represents a polygon in which coordinates given as integers i in data are taken to be pi.

Details and Options

  • Polygon can be used as a geometric region and a graphics primitive.
  • Polygon[{p1,,pn}] 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 line segments an odd number of times.
  • Polygon[{p1,,pn}{{q1,,qm},}] specifies a polygon with holes consisting of an outer polygon Polygon[{p1,,pn}] and one or several inner polygons Polygon[{q1,,qm}],.
  • A point is an element of the polygon if it is in the outer polygon but not in any inner polygon.
  • Polygon[{poly1,poly2,}] is a collection of polygons polyi with or without holes and is treated as a union of polyi for geometric computations.
  • Polygon[{p1,,pn},data] effectively replaces integers i that appear as coordinates in data by the corresponding pi.
  • Polygon[{p1,,pn},{b1,,bn}]polygon boundary points {pb1,,pbk}
    Polygon[{p1,,pn},{{o1,,ok}{{i1,,il},}]outer polygon boundary points {po1,,pok} and inner polygon boundary {pi1,,pil} etc.
    Polygon[{p1,,pn},{{b1,,bn},{o1,,ok}{{i1,,il},},}]a collection of several polygons
  • As a geometric region, the points pi can have any embedding dimension, but must all lie in a plane and have the same embedding dimension.
  • In a graphic, the points pi can be Scaled, Offset, ImageScaled and Dynamic expressions.
  • Graphics rendering 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
  • Point can be used with symbolic points in GeometricScene.

Examples

open all close all

Basic Examples  (2)

A polygon:

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

Its graphic image:

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

Its area:

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

Differently styled 3D polygons:

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

Scope  (21)

Options  (7)

Applications  (3)

Properties & Relations  (4)

Possible Issues  (3)

Neat Examples  (3)

Introduced in 1988
(1.0)
|
Updated in 2019
(12.0)