# How Can I plot two concentric circles with a polygon inscribed in one and circumscribed about the other however I want the polygon to manipulated

So this code is to plot two concentric circles with a polygon inscribed in one and circumscribed about the other:

Manipulate[
Graphics[{Red, Circle[{0, 0}, Cos[Pi/n]], Blue, Circle[{0, 0}, 1],
Green, Line[{Cos[2 Pi #/n], Sin[2 Pi #/n]} & /@ Range[0, n]]}],
{n, 3, 30, 1}]


What can I do to make three additional changes : control the polygon inside in a way that it can be closed or simply lines that end, not necessarily periodic .

To make myself more clear I would want to deal with it like a billiard ball that might make a closed trajectory or a trajectory that ends Any thoughts?

• I don't understand what you mean by making the polygon unclosed, and not necessarily periodic. Could you explain further? May 7, 2016 at 23:28
• "polygon unclosed" - that ain't a polygon anymore, innit? May 8, 2016 at 0:31
• you are right I was not clear enough,, what I mean is that I can control those lines inside in a way it can stay a polygon or become lines. More like a billiard table where the ball might make a closed trajectory or it might hit a corner and end, did you get my point? May 8, 2016 at 1:59
• I edited my question, hope its clearer May 8, 2016 at 2:02

Manipulate[

• 2Pi/n is angle at each corner. For regular polygon it is an integer when you write the vertices in parametric form (inside Line[]). Your earlier question was about regular polygon, so I used integral steps for n. It's not Mathematica, rather Mathematics :) May 8, 2016 at 7:17