Wolfram Archive
Wolfram Programming Lab is a legacy product.
All the same functionality and features, including access to Programming Lab Explorations, are available with Wolfram|One.
Start programming now. »
Try it now »
(no sign-in required)

Draw Circles of Points

Make simple figures based on points evenly spaced around a circle.

Run the code to draw a circle of 12 points. Try other numbers of points:

SHOW/HIDE DETAILS

CirclePoints gives the coordinates of points evenly spaced around a circle. This gives 6 evenly spaced points:

CirclePoints[6]

Draw the points with Graphics:

Graphics[Point[CirclePoints[6]]]

Draw more points:

Graphics[Point[CirclePoints[12]]]

HIDE DETAILS
Graphics[Point[CirclePoints[12]]]

Draw a 12-sided polygon. Try other numbers of points:

SHOW/HIDE DETAILS

Replace Point with Polygon to draw a 12-sided polygon:

Graphics[Polygon[CirclePoints[12]]]

HIDE DETAILS
Graphics[Polygon[CirclePoints[12]]]

Make it interactive. Drag the slider to change the shape:

SHOW/HIDE DETAILS

Here is the code to draw a 12-sided polygon:

Graphics[Polygon[CirclePoints[12]]]

Give yourself a slider to control the number of points using Manipulate. Wrap the expression with Manipulate[...], replace 12 with the variable n, and let n vary from 3 to 12 in steps of 1:

Manipulate[Graphics[Polygon[CirclePoints[n]]], {n, 3, 12, 1}]

HIDE DETAILS
Manipulate[Graphics[Polygon[CirclePoints[n]]], {n, 3, 12, 1}]