Java, Simulation, Programming, Science, Coding.
that.mass * dvdr / ((this.mass + that.mass) * dist); double Jx = J * dx / dist; double Jy = J * dy / dist; this.vx += Jx / this.mass; this.vy += Jy / this.mass; that.vx -= Jx / that.mass; that.vy -= Jy / that.mass; this.count++; that.count++; } After, we have done predicting the collision with a