Try now in the
Open Cloud »
(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:

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

 In[1]:= XCirclePoints[6]
 Out[1]=

Draw the points with Graphics:

 In[2]:= XGraphics[Point[CirclePoints[6]]]
 Out[2]=

Draw more points:

 In[3]:= XGraphics[Point[CirclePoints[12]]]
 Out[3]=

 In[1]:= XGraphics[Point[CirclePoints[12]]]
 Out[1]=

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

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

 In[1]:= XGraphics[Polygon[CirclePoints[12]]]
 Out[1]=

 In[1]:= XGraphics[Polygon[CirclePoints[12]]]
 Out[1]=

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

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

 In[1]:= XGraphics[Polygon[CirclePoints[12]]]
 Out[1]=

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:

 In[2]:= XManipulate[Graphics[Polygon[CirclePoints[n]]], {n, 3, 12, 1}]
 Out[2]=

 In[1]:= XManipulate[Graphics[Polygon[CirclePoints[n]]], {n, 3, 12, 1}]
 Out[1]=