-1

I have a circular series of 250 Cartesian coordinates that are all equidistant from one another (essentially 250 equally spaced points making up a 360 degree circle), and I’d like to create a program (python, preferably) that assigns a label to each point for easier readout. For instance, (0, 500) could be point number 1, while (0, -500) would be point number 125. I’m having trouble coming up with a coherent means of doing this, though. I briefly considered translating to polar coordinates, but that didn’t seem right. I then considered plotting each of the points and manually inputting the translated point for each, but that seems unnecessarily clunky. Any tips on how I can achieve this? Am I going to have to break out my old trigonometry book? Haha

1 Answers1

0

This will print i and the (x, y) coordinate of the points in Python.

import math

n = 250
r = 500
angle = math.pi * 2 / n

for i in range(n):
    x = r * math.cos(angle * i)
    y = r * math.sin(angle * i)
    print(i, x, y)
Peter Collingridge
  • 10,849
  • 3
  • 44
  • 61