# Is it possible to draw a hollow circle using polygon?

The question is simple. I have the following commands

r = 0.24;
R = 0.25;

unitcircle =
Table[{Sin[\[Theta]], Cos[\[Theta]]}, {\[Theta], 2 \[Pi], 0, -\[Pi]/
40}] // N;
incircle = r*unitcircle;
outcircle = R*unitcircle;


which define the outer points and inner points of a hollow circle. Is it possible to draw such a hollow circle using the polygon command?

• Kind of yes, but should you? No. See Annulus and if it should be a polygon take a look at FilledCurve.
– Kuba
Sep 18 '18 at 13:04
• But, with the command polygon no. right? something like playing with the points that you input to Polygon? Sep 18 '18 at 13:06
• If you want to have a differing FaceForm and EdgeForm and no defects, and also everything on the background to appear in an honest fashion, plain Polygon is not enough. FilledCurve is the way to go. Sep 18 '18 at 19:02

Polygon is always filled (it can be filled with white). Use Circle for a "hollow" circle.

r = 0.24; R = 0.25;

Graphics[Circle[{0, 0}, #] & /@ {r, R}]


Graphics[{EdgeForm[Black], White, Polygon[CirclePoints[#, 50]] & /@ {R, r}}]


Note that since the polygons are filled, the smaller circle must be drawn on top (last) to be seen.

EDIT: For a red background, either

Graphics[{White, Annulus[{0, 0}, {r, R}]}, Background -> Red]


Or,

Graphics[{White, Polygon[CirclePoints[R, 50]], Red,
Polygon[CirclePoints[r, 50]]}, Background -> Red]


You could also use EdgeForm to make the borders more distinct.

• thanks a lot for the answer Sep 18 '18 at 13:16
• @MsenRezaee the question is, what do you expect to see if there is e.g. a red background.
– Kuba
Sep 18 '18 at 14:03
• @Kuba I expect to see red everywhere except on the thin surface of my circle Sep 18 '18 at 14:07
• @MsenRezaee that is unclear for me. What should be between those black edges, and what should be inside the inner edge.
– Kuba
Sep 18 '18 at 14:15
• @Kuba in the case of a red background, I expect to see red outside the outer edge and inside the inner edge. But not on the thin surface of the circle. Sep 18 '18 at 14:18

Here's one way:

outer = CirclePoints[2, 100];
AppendTo[outer, First[outer]];
inner = CirclePoints[1, 100];
AppendTo[inner, First[inner]];
Graphics@Polygon[Join[inner, Reverse[outer]]]


A hollow annulus is trickier:

Graphics[{
FaceForm[],
EdgeForm[Black],
Polygon[Join[inner, Reverse[outer]]],
White, Thickness[0.01],
Line[{1.03 First[inner], 0.985 First[outer]}]
}]


I couldn't get away with just a polygon for this one, I had to cover up the line from where the inner circle connects to the outer. Had I done this with a polygon it would still be two polygons and not one. We can also draw another polygon like the first one here above in white to make the first one appear hollow.

As an aside, I see that Annulus has been mentioned but no one has shown how to make it hollow as far as I can tell:

Graphics[{
FaceForm[],
EdgeForm[Black],
Annulus[]
}]


FilledCurve can be used to achieve polygons with holes defined using lines (but also filled Bezier curves and B-splines can be used). Here one is formed by two very circle-like polygons). Red line on background for illustrative purposes:

Graphics[
{Thick, Red, Line[.25 {{-1, -1}, {1, 1}}], FaceForm@White, EdgeForm@Black,
FilledCurve[{Line@CirclePoints[#, 100]} & /@ {.24, .25}]}]