Let's say very small bullet travel with vel_x and vel_y. It hits a big ball surface and bounce back with a new_vel_x and new_vel_y;
We only know the where the bullet hit the surface (bullet_x,bullet_y), the center of the ball (ball_x, ball_y), and the velocity of the bullet vel_x and vel_y. how can I get the reflected new velocity: new_vel_x and new_vel_y.
PS, I know the reflection matrix for reflection about y-axis, x-axis, and y=x, but I don't know the reflection matrix at any angle.
If reflection line is y=mx, then the reflection matrix is:
where
the bullet speed is v (vel_x, vel_y), then new velocity (new_x, new_y) is:
This is a test on python: