https://zonebahama.blogspot.com/2018/05/ball-and-beam-javascript-simulation.html