Physics, Science, Programming, Deep Dives, Thoughts And Theory.
to matrices for i,m in enumerate(self.molecules): self.positions[i,:]=m.get_position() self.velocities[i,:]=m.get_velocity() self.colors[i]=m.get_color() self.masses[i]=m.get_mass() #Make vectors with magnitudes of positions and velocities self.positions_norm=np.linalg.norm(self.positions,axis=1)