RegularPolygon

RegularPolygon[n]

gives the regular polygon with n vertices equally spaced around the unit circle.

RegularPolygon[r,n]

gives the regular polygon of radius r.

RegularPolygon[{r,θ},n]

starts at angle θ with respect to the axis.

RegularPolygon[{x,y},rspec,n]

centers the polygon at {x,y}.

Details and Options

Examples

open allclose all

Basic Examples  (3)

A pentagon:

Different styles applied to RegularPolygon:

Area and centroid:

Scope  (17)

Graphics  (7)

Specification  (4)

Generate an equilateral triangle, square, pentagon, hexagon, etc.:

Generate pentagons of varying radii:

Generate triangles of varying starting angles:

Place six hexagons equally spaced around the unit circle:

Styling  (2)

Color directives specify the face colors of regular polygons:

FaceForm and EdgeForm can be used to specify the styles of the interior and boundary:

Coordinate  (1)

Use Dynamic coordinates:

And dynamic radii:

Regions  (10)

Embedding dimension:

Geometric dimension:

Point membership test:

Get conditions for point membership:

Area:

Centroid:

Distance from a point:

The distance to the nearest point in the unit disk:

Signed distance from a point:

Signed distance to the unit disk:

Nearest point in the region:

Nearest points:

A regular polygon is bounded:

Get its range:

Integrate over a hexagon:

Optimize over a hexagon:

Solve equations in a hexagon:

Applications  (4)

Create a star region by taking the RegionUnion of rotated triangles about a common origin:

Create 3D extrusions with RegionProduct:

Plot a function over a hexagon:

Some lattices will have regular polygons as their cells. Consider the lattice basis:

Generate lattice points and tiles:

Visualize the tiling and lattice points:

Properties & Relations  (3)

A RegularPolygon is a Polygon whose vertices are equally spaced around the unit circle:

Use CirclePoints to generate points equally spaced around the unit circle:

The area of a regular polygon on the unit circle as is the area of a unit Disk:

Neat Examples  (2)

A collection of random regular polygons:

Overlap regular polygons of increasing radii and vertices:

Wolfram Research (2015), RegularPolygon, Wolfram Language function, https://reference.wolfram.com/language/ref/RegularPolygon.html (updated 2019).

Text

Wolfram Research (2015), RegularPolygon, Wolfram Language function, https://reference.wolfram.com/language/ref/RegularPolygon.html (updated 2019).

CMS

Wolfram Language. 2015. "RegularPolygon." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/RegularPolygon.html.

APA

Wolfram Language. (2015). RegularPolygon. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegularPolygon.html

BibTeX

@misc{reference.wolfram_2023_regularpolygon, author="Wolfram Research", title="{RegularPolygon}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/RegularPolygon.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_regularpolygon, organization={Wolfram Research}, title={RegularPolygon}, year={2019}, url={https://reference.wolfram.com/language/ref/RegularPolygon.html}, note=[Accessed: 19-March-2024 ]}