commit
This commit is contained in:
parent
743cd131b4
commit
1087603e07
1 changed files with 4 additions and 6 deletions
10
main.py
10
main.py
|
@ -26,10 +26,10 @@ class Planet:
|
|||
self.x += self.dx * dt
|
||||
self.y += self.dy * dt
|
||||
|
||||
x1 = (self.x + self.size) / scale + WIDTH / 2
|
||||
y1 = (self.y + self.size) / scale + HEIGHT / 2
|
||||
x2 = (self.x + self.size * 3) / scale + WIDTH / 2
|
||||
y2 = (self.y + self.size * 3) / scale + HEIGHT / 2
|
||||
x1 = (self.x - self.size) / scale + WIDTH / 2
|
||||
y1 = (self.y - self.size) / scale + HEIGHT / 2
|
||||
x2 = (self.x + self.size) / scale + WIDTH / 2
|
||||
y2 = (self.y + self.size) / scale + HEIGHT / 2
|
||||
|
||||
self.canvas.create_oval(x1, y1, x2, y2, fill=self.color)
|
||||
|
||||
|
@ -63,8 +63,6 @@ class Planet:
|
|||
M = planet.mass
|
||||
r = sqrt((self.x - planet.x)**2 + (self.y - planet.y)**2)
|
||||
|
||||
print(r)
|
||||
|
||||
v = sqrt(G * M / r)
|
||||
|
||||
self.set_initial_velocity(0, v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue