Three Body Problem

import numpy as np from scene import * class Simulation(Scene): def setup(self): =0 = ’black’ self.N=3 =[] for i in range(self.N): (SpriteNode(’shp:Circle’)) =1 =1e-3 =(self.N,3)/2 =(self.N,3)/2 =((self.N,,3)) colors=[“white“,“#FFCC33“,“#FF3333“] for i,cell in enumerate(): =([i,0]*,[i,1]*) =colors[i] (cell) def update(self): for i in range(): [:,i,:]=(,i 1,axis=0) r2=(((),axis=2) 1e-8).reshape(self.N,,1) f=(**1.5,axis=1) =f* =*
Back to Top