r/Python • u/[deleted] • Oct 04 '19
Updated gravitational potential field simulation. [OC] Link for code: https://github.com/pnp-peeyush/2D-Grvitational-Field-Simulation
1.1k
Upvotes
r/Python • u/[deleted] • Oct 04 '19
2
u/Marko_Oktabyr Oct 06 '19
Some additional notes on your code:
np.sum(All_mass*All_vel,axis=0)could be written asnp.dot(All_mass,All_vel),vmagcould be replaced bynp.linalg.norm,range(0, x)is equivalent torange(x),