Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
DoPerfectElasticCollision is a math code snippet to determine the velocities and angles of two 2D round objects after a perfect elastic collision.
When two perfect globes (or disks) collide and bounce perfectly elastically, all impulse is maintained and transferred maximally. Near-perfect elastic collisions can be observed when playing snooker or air-hockey. It is a relatively mathematical complex function and the image showing all angles and vectors (png) should clear up on the function's working. The function assumes equals mass of both players.
I (re)developed DoPerfectElasticCollision for the game Boenken.
To use DoPerfectElasticCollision, you must already have defined the GetAngle function.
#include <cmath> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.