Physics, Science, Programming, Deep Dives, Thoughts And Theory.
(np.dot(u_1-u_2,x_1-x_2)/np.linalg.norm(x_1-x_2)**2) * (x_1 - x_2) v_2=u_2 - 2*ms_1/(ms_1 + ms_2) * (np.dot(u_2-u_1,x_2-x_1)/np.linalg.norm(x_2-x_1)**2) * (x_2 - x_1) #Update velocities of the molecule objects m_1.set_velocity(v_1) m_2.set_velocity(v_2) #2: Update positions #Iterate over all the