S
sparx10
I'm trying to move an object along a circle (orbit), and I did come up withthis:
radius = 100
from math import sqrt
for x in range(-radius,radius):
y = sqrt(radius**2-x**2)
print(x, y)
however it moves faster at the beginning and end of the range (y value changes faster than x value) because the x value is changing at a constant ratebut the y value isn't. I can't think of a way to get something to move smoothly around in a circle though..
radius = 100
from math import sqrt
for x in range(-radius,radius):
y = sqrt(radius**2-x**2)
print(x, y)
however it moves faster at the beginning and end of the range (y value changes faster than x value) because the x value is changing at a constant ratebut the y value isn't. I can't think of a way to get something to move smoothly around in a circle though..