Object and Forces (or Bouncing Spheres Revamped)
29 Apr 2020

This one will be a lot like the bouncing spheres experiment. Unlike the bouncing spheres experiment I have written this in a more object oriented fashion. Each ball here is an object on which forces are applied. There are three forces that act on the object.

  1. Gravity. The balls will feel a force towards the ground.
  2. Collision among the balls.
  3. Wind. Wind can be applied by clicking the canvas.

By far the most complex and the most interesting part of this experiment is the collision detection and collision resolution. Collision detection is relatively easy. Collision resolution is not. I took the algorithm for Collision Resolution from this link.

Sorry, your browser does not support Canvas.
1. objforces.js - Download, index.html
//Code goes here

Javascript Demos

Here's a bunch of javascript... things I wrote over the years whenever time permitted.