I'm writing a gas dynamics simulation. I created a two degree of freedom simulation, where all the gas molecules are represented as hard spheres and their collisions are perfectly elastic. However, I want to take that into three dimensions. I have the XYZ coordinates of all of the moving spheres, along with their vectors. By subtracting the difference between two vectors, I can essentially simplify the problem to a moving sphere colliding with a stationary sphere. We can assume that the spheres will collide because the moving sphere is calculated to approach closer than the sum of the spheres' radii.
How can I find when and where the spheres will collide?
Any thoughts would be much appreciated, and let me know if there is anything I can do to clarify the problem.
The spheres will collide when their centers are a distance apart equal to the sum of their radii. The collision point is a point on the line between the two centers. If you have the vector coordinates of these centers that should be relatively easy to figure out.