# Calculate the reflected path

## Recommended Posts

ok_woei    122
Hi all, I am trying to work out a physics engine which a particle is bouncing inside a sphere. You guys have any idea on how to calculate the reflected path of the particle after the particle hit the boundary of the sphere.

##### Share on other sites
erissian    727
It will be reflected across the axis of the radius.

More specifically, a projectile's path will be reflected of the normal of the surface it impacts. In a sphere, all surface normals in the radial direction.

##### Share on other sites
ok_woei    122
So in this case, the angle (with respect to surface normal) of the path before impact is same as the angle (with respect to surface normal) of the path after impact?

##### Share on other sites
Wc-duck    128
maby this will be interesting for you?
http://mathworld.wolfram.com/Reflection.html

##### Share on other sites
erissian    727
Exactly so.

If you take a simple example, a ball bouncing off of flat ground elastically, the impact is purely in the vertical direction. That means only the vertical velocity is changed, and the horizontal velocity isn't affected at all. So the vertical velocity is simply reversed, and the horizontal velocity is unchanged; that means that the angle of impact is the angle of reflection, much like light reflecting off a surface.

This can be more generalized to the ball's velocity in the direction of the surface normal is reversed, while the velocity tangent to the surface is unchanged. (Again, for elastic collisions.)