just click and watch you can go and change some of the variables such as ballSize gravityY gravityX
Updates- 04/40/15: fixed a slight bug with the dot product, and now it has a more realistic collision response