Pool on an elliptical table.
Based on the real-life LOOP game presented on Numberphile by Alex Bellos.
Takes advantage of elliptical geometry. When the path of a ball goes through one focus point, it will always bounce off the edge and go through the other focus point. Learn more about it in this video or this webpage.
Download and run source files with Processing.
The objective of LOOP is to win by potting a colored ball and then the black ball.
Player 1 is assigned the red ball, Player 2 is assigned the yellow ball.
Turns alternate as players take shots. Potting their colored ball gives the current player another turn.
A player who pots the black with his or her colour still on the table loses the game.
The key to the strategy of LOOP is to consider the focus points. When the path of a ball goes through a focus point, its path will always continue to the other focus point due to elliptical geometry. Learn more about it in this video.
Move the ball by holding down the mouse and releasing it.
Numberphile channel: http://youtube.com/numberphile
LOOP's Official Website: http://www.loop-the-game.com/
Closest point on an elliptic arc algorithm by user 'Spektre': http://stackoverflow.com/questions/36260793/algorithm-for-shortest-distance-from-a-point-to-an-elliptic-arc
The Physics of Billiards, for Ball to Ball Collision by NCSA at University of Illinois: http://archive.ncsa.illinois.edu/Classes/MATH198/townsend/math.html