Java, Simulation, Programming, Science, Coding.
above mentioned function. public void bounceOffVerticalWall() { vx = -vx; count++; } public void bounceOffHorizontalWall() { vy = -vy; count++; } These two function just sets its axis to negative whenever they touch vertical or horizontal walls respectively. public double timeToHit(Particle that) {