# Showing a polygon in Mathematica

Could anyone be able to construct two shapes, a $n$-gon $P$ and a regular $n$-gon $Q$, say $n=5$?

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Commented Jul 27, 2016 at 13:50

You can create a regular polygon of $n$ points thusly:

Graphics[{EdgeForm[Thick], White, Polygon[CirclePoints[5]]}]


Or use RegularPolygon[]

For irregular polygons, you need to construct the points yourself:

Graphics[{EdgeForm[Thick], White,
Polygon[{{3, 0}, {0, -Sqrt[3]}, {-1, 0}, {1, 1}, {1, 2}}]}]


• This is exactly what I wanted, thanks! Could you remove the black color in their interiors? Commented Jul 27, 2016 at 13:40
• @DavidLabrecque Replace Polygon by Line Commented Jul 27, 2016 at 13:41
• ...and RegularPolygon[] is built-in, too. Commented Jul 27, 2016 at 13:43
• @Coolwater Possible, but then the first and last points don't connect. Commented Jul 27, 2016 at 13:44
• For an arbitrary set of n points: Graphics[Line[points[[FindShortestTour[points][[-1]]]]]] Commented Jul 27, 2016 at 14:13