# Points on circle equally spaced [duplicate]

This might be a really simple question, but how do you generate equally spaced points on a circle? I have looked here and here, have played around for ages - I am sure I am missing something very obvious :/ Here does it, but is there anything more straightforward?

Obviously

ParametricPlot[{Sin[x], Cos[x]}, {x, -π, π}]


plots it, and

cplot[m_] := g1 = (d = (q = 100;
f = (lop =
Transpose[{Flatten[
Reverse[
Table[Gamma[y], {y, 0, q}]] /. {ComplexInfinity -> m}],
Flatten[Table[x^n, {n, 0, q}]]}];
{#1*#2} & @@@ lop);
Flatten[f];
Total[f]);
sol = Solve[d == 0];
r = ListPlot[{{Re@x, Im@x} /. sol}, AspectRatio -> Automatic,
PlotStyle -> Black];
Show[r, Axes -> False, ImageSize -> 800]);
Show[cplot[#] & /@ Range]


is a roots example, but was after something simpler.

• Hint: Divide $[0, 2\pi)$ into $n$ equal segments...
– rm -rf
Mar 25, 2014 at 23:14
• I had worked that much out ... just have a Mathematica mental block :/ Mar 25, 2014 at 23:16
• Many functions' roots do it - just wanted a nice simple way to do it :/ Mar 25, 2014 at 23:17
• – Kuba
Mar 25, 2014 at 23:52
• @martin Re curling....Perhaps this could be modified: mathematica.stackexchange.com/questions/20004/… Mar 25, 2014 at 23:58

Here is a rather general solution to your problem. It produces a list of the coordinates of n regularly spaced points on a circle centered at {cx, cy} with radius r, where the initial point is rotated counterclockwise from the x-axis by initθ radians (defaults to 0).

validNum = Except[_Complex, _?NumericQ];
regSpacedPts[center : {cx : validNum, cy : validNum : 0}, r : validNum,
n_Integer /; n > 0, initθ : validNum] :=
Table[center + r {Cos[# + initθ], Sin[# + initθ]} &[N[ 2 π k/n]], {k, 0, n - 1}]


Here is an application.

With[{xy = {1/4., 3/2}, r = .5, n = 5, θ = 90 °},
Graphics[{Circle[xy, r],
PointSize[Large], Point[regSpacedPts[xy, r, n, θ]],
Red, Point[xy]},
PlotRange -> {{-1/4, 3/4}, {1, 2}},
Frame -> True, • OK, this gives me loads of things to study - 'Chop, With and Except I am still unsure of - will give them a go - again - many thanks. Mar 26, 2014 at 0:24
• @martin. Chop is a bit of fussiness on my part. You could probably remove it without any harm. The validNum pattern uses Except to exclude complex numbers from being used as arguments. Mar 26, 2014 at 0:29
• @martin. I made some corrections you will want to attend to. I removed Chop (really not needed) and I stopped an extra copy of first point from being generated. This code was taken from some code It wrote to generate regular polygons, which used the extra point to close the polygon, something not needed for your application. Mar 26, 2014 at 0:45

Using ListPolarPlot you can do the following:

r = 1;
points = 6;
angle = 2 π / points;
Show[
ParametricPlot[{r * Sin[x], r * Cos[x]}, {x, -π, π}],
ListPolarPlot[Table[{angle * n, r}, {n, 1, points}], PlotStyle->{Black, PointSize[Large]}]
]

• Great - thank you! I'm sure I will be kicking myself in a minute :/ Mar 25, 2014 at 23:18
• ListPolarPlot - Great! :) Mar 25, 2014 at 23:19
• Is there any way of converting these points to data that a regular ListPlot` can plot? Mar 25, 2014 at 23:38