New speed after a collision with a circle

On a round billiard table, a billiard ball collides with the boundary of this table with a certain speed v1. This collision is defined as follows:

double s = sqrt( (px-a)*(px-a) + (py-b)*(py-b) ); if (s<r) // point lies inside circle // do nothing else if (s==r) // point lies on circle // calculate new velocity else if (s>r) // point lies outside circle // move point back onto circle (I already have that part) // calculate new velocity 

Now, how can we calculate the new velocity v2 after the collision, so that the angle of incidence = angle of reflection (elastic collision)?

PS: The billiard ball is represented by the point p (x, y) with the velocity vector v (x, y). Simulation without friction.

+4
source share
2 answers

Assuming you are creating a simple (game) billiard simulator, you can use something like:

 v_new = coeff*(v_old - 2*dot(v_old, boundary_normal)*boundary_normal); 

Here v_old is your current velocity vector, and boundary_normal is the inwardly normal circle of your pool table at the point of impact. If you know the center c your pivot table and you have a hit point p , then the normal is just normalize(cp) . That is, the normalized vector that you get when subtracting p from c .

Now I took coeff as a leaching factor between 0 (no speed more after a hit) and 1 (same speed after a hit). You can make this more plausible by determining the correct restitution coefficient.

In the end, all the formulas above are simply reflection , as you could see, for example, in the base ray. As said, this is a rather crude abstraction from the exact modeling of physics, but is likely to cope with this task.

+3
source

As stated in the comments, this is a matter of mechanics. See the momentum definition. What you want, in particular, is covered by elastic section collisions.

0
source

Source: https://habr.com/ru/post/1385314/


All Articles