How can I incrementally calculate the angle from angle 0 and the point (x, y) in a circumference path if I have the center of the circle coordinates and the radius of the circle.

I have 127 segments each with 5 points in a segment. This is 635 in circumference. The closest radius to this is 102.

  • $\begingroup$ The question isn't terribly clear. Could you try to clarify? What, e.g. is the center (it's coordinates), and what is the radius? I'm not sure what you mean when you say you have the radius, but end your post with "the closest radius to 'this' [what this] is 102"? $\endgroup$ – Namaste Apr 28 '13 at 15:34
  • $\begingroup$ I have 127 segments that I need to render points for, each segment has 5 points. This gives me 635. So I need a circle with the circumference of 635, each point in the circumference can be mapped by a point in a segment. Calculating the radius of this causes a flooring of a floating point number to an integer of 102. I would like to calculate each point in the circumference, each point in each segment. So e.g. for each angle in the circle, 360 is used, incremented by 1 each time, how can I determine the (x, y) coordinate of each point in the circumference path, (going clockwise)? $\endgroup$ – jarryd Apr 28 '13 at 15:42
  • $\begingroup$ If you have 635 points, and want them evenly dispersed along a circle, you can increment the angle by $\dfrac{360}{635}^\circ$. $\endgroup$ – Namaste Apr 28 '13 at 15:59

$$x = r\cos\theta, \quad y = r\sin\theta, \quad\text{for circle radius $r$ centered at origin}$$

With an arbitrary center $(x_c, y_c)$, then

$$(x - x_c) = r\cos\theta, \quad (y - y_c) = r\sin\theta$$

$$x = r\cos\theta + x_c, \quad y = r\sin\theta + y_c$$

$$\tan\theta = \dfrac{y - y_c}{x - x_c} \iff \theta = \arctan\left(\frac{y - y_c}{x - x_c}\right)$$

  • $\begingroup$ Thank you for your time on helping me. :) $\endgroup$ – jarryd Apr 28 '13 at 17:22
  • $\begingroup$ You're welcome, Helium3! $\endgroup$ – Namaste Apr 28 '13 at 17:25
  • $\begingroup$ Nice, clean answer +1 $\endgroup$ – Amzoti Apr 29 '13 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.