Dec-25-2017, 02:50 AM

I want one circle to orbit another along a pre-drawn circular path of radius 300. I know others have asked the same question, but all of those answers covered how to calculate coordinates that the object must travel through, not how to actually make the object move. This is especially tricky for me since there's no "move to a point" command in Python.

I can calculate the coordinates that the object must travel through, using the mathematical equation of a circle, and the coordinates seem accurate. But how do I make "acircle" move through those calculated coordinates?

Thanks!

def move_circle(acircle): #Specifies parameters to draw the new orbital new_orbital = Circle(atom_center, 300) new_orbital.setOutline("red") new_orbital.draw(win) #Calculates the center of the circle to be moved a = acircle.getCenter() b = a.getX() c = a.getY() for i in range(int(-b),int(b)): radius = 300 theta = math.radians(i) x = radius*math.cos(theta) y = radius*math.sin(theta) print(x,y) s = (b-x)**2 t = (c-y)**2 d = sqrt(s+t)(The last few lines of code are just me experimenting with the distance formula).

I can calculate the coordinates that the object must travel through, using the mathematical equation of a circle, and the coordinates seem accurate. But how do I make "acircle" move through those calculated coordinates?

Thanks!