How many equally spaced points are needed around a circle of radius r such that every point is d units apart from eachother

anglegeometry

This question is a bit different than what I have seen here. I know how to calculate the positions such that n points will be equally spaced around a circle however I am trying to solve a different problem. Lets say I am trying to draw a circle with a computer program and I want to intelligently decide how many points will be needed such that the lines between the points are d units a part. This formula would allow for small circles to be drawn with few points but large circles to be drawn with many.

I have tried to solve for d using the following formula however I am not sure I solved it right. In this formula I am solving for dr or the ammount I will need to increment the angle by for each of these points. The number of points needed would then be ceil((2 * PI) / dr)

d = |(r*(cos(dr) - cos(0)))^2 + (r*(sin(dr) - sin(0)))^2|

And I solved this down to dr = (((d/r*r)-2)/-2.0f) but I do not think that that is right.

I am also told the solution may be dr = d / (2.0 * r * PI + 6) but I have no idea where this came from.

Best Answer

The figure below shows one side of the polygon that represents the circle. The radius of your circle is $g$ or $h$ and the side of the polygon is $BC$. You ask that $|BC|=d$. From the upper right triangle we have $\frac d2=h\sin \theta$. This gives that the full angle subtended by the side is $2 \theta=\arcsin \frac d{2h}$. The number of sides is $\frac \pi \theta$. If this doesn't come out even, presumably you want to round up in number of sides and down in the length of the sides.

enter image description here