How to model particle bouncing off of a curved surface in 3D?
Compute normal vector as cross product of two tangent vectors to your surface
Normalize it to get unit normal
Compute inner product (dot product) of minus velocity and normal vector
Multiply inner product with unit normal to get projection on normal
Subtract projection on normal from minus velocity
Add that to projection to get new speed vector
I am trying to simulate a particle bouncing off the sides of a cylinder (inside) or any closed curved surface in 3 dimensions. 
At the moment of interaction with the surface, I have the position vector, the velocity vector, and the plane tangent to the surface at the intersection, and I am looking to derive the new velocity vector. 
Currently coding in Python, but pseudocode/general algorithm would be immensely helpful as well.