Relative Content

Tag Archive for pythonphysicssimulatorgravity

Why is there an error in the gravity calculation in my python code?

import pygame from pygame import * import math class orb: def __init__(self, mass=1, s0=[0,0], v0=[0,0], a=[0,0], r=10, color=(255, 255, 255), fix = False, F=0, Fx=0, Fy=0): self.a= a self.mass=mass self.r=r self.t = 0 self.v0=v0 self.v=[self.v0[0], self.v0[1]] self.s0=s0 self.s=[self.s0[0], self.s0[1]] self.color=color self.fix = fix self.F=F self.Fx = Fx self.Fy = Fy calculating the position of the […]