when the orbs come to close they start to stutter oddly how could i fix that
from random import Random, randint, random
from fractions import Fraction
import math
import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((800,600))
moveEvent, t = pygame.USEREVENT+1, 10
pygame.time.set_timer(moveEvent, t)
v = 0
while True:
#mass of orbs
m = 2e15
#diamiter of orbs
dia = 20
#distance
d = math.sqrt(pow((X_2 - X_1), 2) + pow((Y_2 - Y_1), 2))
#gravity
g = (6.674e-11*m*m)/pow(d, 2)
#acceleration
a = g/m
rise = (Y_2 - Y_1)
run = (X_2 - X_1)
#slope
slope = round(rise/run, 3)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == moveEvent:
v += a/100
angle = math.atan(slope)*180/math.pi
v_X = v*math.cos(angle)
v_Y = v*math.sin(angle)
print("v_X, v_Y = " + str(v_X) + ", " + str(v_Y))
screen.fill((0,0,0))
pygame.draw.circle(screen, (100,100,100), (X_1,Y_1), dia, 0)
pygame.draw.circle(screen, (100,100,100), (X_2,Y_2), dia, 0)
pygame.display.update()
X_1 += v_X
Y_1 += v_Y
X_2 -= v_X
Y_2 -= v_Y
i need help with this(i thought it was that when the orbs got to 0 distance the gravity was undefined but that wasn't the problem)