# How does CirclePoints function actually work when drawing a polygon?

By reading that CirclePoints gives the positions of n points equally spaced around the unit circle, I understood that :

Graphics[{Green, Polygon[CirclePoints]}]


is equivalent to drawing a polygon into a circumscribed circle of radius 1 and centered as 0, 0.

I don't understand what CirclePoints with a real number does:

look at the picture:

Graphics[{Red, Polygon[CirclePoints[4.434335]], Green,
Polygon[CirclePoints]}] What is the meaning of placing "4.434335" points around the unit circle ?How do they come equally spaced ?

Look at the red polygon, they are not equally spaced, but I don't understand how the perimeter of the inner circle would be split.

• This is off-topic but the answers suggested me this comment. It is fascinating to see a phase transition between polygons. The first n-1 vertexes are placed at equal distance by dividing the radiant of the circle; last vertex will be set upon the "remaining" angle respect to itself and first vertex. So for limit of the real number towards the next integer digit, next polygon pops up. E.g. Area[Polygon[CirclePoints]], Area[Polygon[myCirclePoints[3.99999]]], Area[Polygon[myCirclePoints[3.9999999999]]] converge towards 1.0000, then Area[Polygon[myCirclePoints]] "jumps" to 2.0 – user305883 Oct 15 '18 at 7:51

The details section of the documentation says the following:

• In CirclePoints[n], n does not have to be an exact integer. The angles between successive vectors are always $$\frac{2\pi}{n}$$.
• If the angle $$\theta_1$$ is not given, it is assumed to be $$\pi/n - \pi/2$$, ...

($$\theta_1$$ is the starting angle.)

Here is a simple implementation to test this:

circlePoints[n_] := Module[{start, diff},
start = Pi/n - Pi/2;
diff = 2 Pi/n;
Table[{Cos[start + i diff], Sin[start + i diff]}, {i, 0, Floor[n] - 1}]
]

Graphics[{
Green,
Polygon[CirclePoints[4.434335]],
FaceForm[Transparent],
EdgeForm[{Red, Thick}],
Polygon[circlePoints[4.434335]]
}] How do they come equally spaced?

The key here is that successive vectors are equally spaced. The angle between the first and last vectors is not the same as the other angles unless $$n$$ is an integer.

• Does RegularPolygon[] have the same behavior? – J. M. will be back soon Oct 14 '18 at 1:25
• @J.M.issomewhatokay. Yes – C. E. Oct 14 '18 at 6:22
• @C.E. thank you for the explanation. So can I summarise the reason is that the diff angle ( 2Pi/n , that sets distance between the points) can be split in equal parts only if n is integer - otherwise you ll have the remaining angle, between first and last vector, will result different. – user305883 Oct 15 '18 at 7:29
• @user305883 yes, that's correct. – C. E. Oct 15 '18 at 7:49

here is how CirclePoints work try this..

Graphics[{Point@CirclePoints[40.99]}] the above misses a point
see this one

Graphics[{Point@CirclePoints}]


now

Graphics[{Point@CirclePoints[4.43]}]


misses the fifth point...
this one

Graphics[{Point@CirclePoints}] • thank you for your time! I personally liked and found useful the visual example to show what the function does. I consulted META meta.stackexchange.com/questions/5234/… and think that to mark as correct answer it lack explanation of what the function does. – user305883 Oct 15 '18 at 7:16
• that's ok! I'm glad that I found a way to visualize the problem and wanted to share. Thank's for you kind words – J42161217 Oct 15 '18 at 10:24
• thank you @J42161217 - I found visual examples often very very useful to understand concepts. – user305883 Oct 15 '18 at 11:56