Physics, Science, Programming, Deep Dives, Thoughts And Theory.
self.distance_matrix[i,j]=np.linalg.norm(self.positions[i,:]-self.positions[j,:]) #Set diagonal entries (distance with itself) to a high value #to prevent them for appearing in the subsequent distance filter np.fill_diagonal(self.distance_matrix,1e5) Detecting and handling collisions Here, we come