# Automatically draw chords from n-1 points on a circle to a fixed point on the circle

I want to put n equally spaced points on a circle and automatically draw chords from all points to a fixed point preferably P(0,0).

I have managed to draw the points and the circle so far with

func[n_] := Graphics[{Orange, Thickness[0.001],
{Circle[{0, 0}, 1], {Darker[Blue], PointSize@0.02,
Point[Table[{Cos[a], Sin[a]}, {a, 0, 2 \[Pi] - (2 \[Pi])/n, (
2 \[Pi])/n}]]}}}];


Manipulate[func[n], {n, 3, 50}]

For n=6 it should somehow look like this

func[n_] := Graphics[{Orange, Thickness[0.001],
{{Circle[{0, 0}, 1], {Darker[Blue], PointSize@0.02,
Point[Table[{Cos[a], Sin[a]}, {a, 0, 2 \[Pi] - (2 \[Pi])/n, (
2 \[Pi])/n}]]}},
Line[{
{Cos[(2 \[Pi])/6], Sin[(2 \[Pi])/6]}, {Cos,
Sin}, {Cos[2 (2 \[Pi])/6], Sin[2 (2 \[Pi])/6]}, {Cos,
Sin}, {Cos[3 (2 \[Pi])/6], Sin[3 (2 \[Pi])/6]}, {Cos,
Sin}, {Cos[4 (2 \[Pi])/6], Sin[4 (2 \[Pi])/6]}, {Cos,
Sin}, {Cos[5 (2 \[Pi])/6], Sin[5 (2 \[Pi])/6]}, {Cos,
Sin}
}]}}];


Manipulate[func[n], {n, 3, 50}]

Help is very much appreciated.

• Sorry, I meant point P(1,0) – Guy Foxx Nov 16 '20 at 8:53

You can also use StarGraph to get the desired picture:

Manipulate[StarGraph[n, Prolog -> Circle[], ImagePadding -> 20, PlotRange -> 1],
{{n, 7}, 3, 20, 1}] Specify the vertex coordinates to have all the points on the circle:

Manipulate[StarGraph[n, Prolog -> Circle[],
VertexCoordinates -> CirclePoints[n], ImagePadding -> 20,
PlotRange -> 1],
{{n, 7}, 2, 20, 1}] We can also use LocatorPane and add/delete nodes using (ALT + Click):

DynamicModule[{pts = CirclePoints},
LocatorPane[Dynamic[pts, (pts = Normalize /@ #) &],
Dynamic[StarGraph[Length @ pts,
VertexCoordinates -> pts,
Prolog -> Circle[],
GraphStyle -> "ThickEdge",
VertexShapeFunction -> (GraphElementData["Star"][#, #2, {1, 1}/15] &),
PlotRange -> 1]],
Appearance -> None, LocatorAutoCreate -> {2, 20}]] chords[n_Integer?Positive] :=
Graphics[
{Orange,
Circle[],
GraphicsComplex[CirclePoints[{1, 0}, n],
{
Table[Line[{1, k}], {k, 2, n}],
{Black, PointSize[Large], Point@Range[n]}
}]
}
]

Manipulate[chords[n], {{n, 6}, 1, 20, 1}] Since you said the fixed point should be at the origin; however, you can move it elsewhere.

Clear["Global*"]

Manipulate[
Graphics[{
Circle[],
Blue,
Line[{pt, #}] & /@ CirclePoints[n]}],
{{pt, {0, 0}}, Locator},
{{n, 8}, Range[2, 20]}] Manipulate[
PolarPlot[1, {t, 0, 2 Pi},
PolarGridLines -> {Subdivide[0, 2 \[Pi], n], None},
GridLinesStyle -> Directive[Dashed, Orange],
PolarAxesOrigin -> {0, 1}, PolarTicks -> {None, None},
PolarAxes -> False, Axes -> False], {n, 1, 20, 1}]
` 