# Physics needed to build a top down billiards game [duplicate]

Possible Duplicate:
How are these balls reflected after they hit each other?

I was wondering what sort of physics equations would I need in order to build a top down billiards game? I tried using Box2D (a 2D physics engine for games) but it has issues with objects going through other objects when the velocity is too fast. So I decided to do all the physics by scratch.

So, what would be all the physics I need to create a top down 2D billiards game?

Thanks!

## marked as duplicate by Mark Eichenlaub, David Z♦Aug 6 '11 at 0:17

• Though this question is tagged collision, which was indeed covered by the earlier questions, collisions make up just a small part (and not the physically most interesting one) of billiard ball dynamics. Perhaps some other tags would fit better, I aimed my answer at those other aspects anyway. – leftaroundabout Aug 6 '11 at 1:25
• Could you recommend any tags? I'd be happy to ad them. – Edgar Miranda Aug 6 '11 at 18:32

Obviously, you will describe the balls classically and probably not at relativistic speeds (though that would be interesting...) so pretty much all you need is Newton $\mathbf{F}=m\cdot \mathbf{a}$ for the frictional forces. However, describing the balls as solid spheres, you don't just need directed forces but also torques to describe the rotation $\pmb{\omega}$. It changes as $$J\cdot\dot{\pmb{\omega}} = \pmb{\tau}$$ where the moment of inertia $J$ would, for a general rigid body, be a tensor but is for spherical objects just a number. The torque $\pmb{\tau}$ consists of
• The rolling friction, which occurs whenever a ball moves. It should be possible to model this simply by a multiple of the vector the ball would rotate about if it did properly roll, that is $$\pmb{\tau}_\mathrm{roll} = \eta_\mathrm{roll}\:\mathbf{e}_z\times \mathbf{v}$$ where $\mathbf{v}=\dot{\mathbf{r}}$ is assumed to always lie in the $xy$ plane, disregarding the possibility of balls jumping.
• The sliding friction, that is, the part of the friction that causes the balls to roll in the first place rather than just gliding over the surface like a curling stone. This actually originates as a directed force rather than a torque: if the ball could not rotate, if would just be the aforementioned $\mathbf{F}=m\cdot \mathbf{a}=m\cdot\ddot{\mathbf{r}}$. Such a "dry" sliding force has a pretty much constant strength but always points into the direction the surfaces slide against each other. $\mathbf{F}=m\mu\frac{\mathbf{v}_\mathrm{rel.slide}}{\|\mathbf{v}_\mathrm{rel.slide}\|}$ with some constant $\mu$ and $$\mathbf{v}_\mathrm{rel.slide} = \mathbf{v} - \mathbf{v}_\mathrm{ballbottom}$$ where ($R$ is the ball radius) $$\mathbf{v}_\mathrm{ballbottom} = \left(\begin{smallmatrix}\mathbf{e}_x\\\mathbf{e}_y\\\mathbf{e}_z\end{smallmatrix}\right)\left(\begin{smallmatrix}0&-1&0\\1&0&0\\0&0&0\end{smallmatrix}\right)\left(\begin{smallmatrix}\mathbf{e}_x\\\mathbf{e}_y\\\mathbf{e}_z\end{smallmatrix}\right)R\cdot\pmb{\omega}.$$
With a rotationable ball the same force also comes up as a torque because it's applied just to the low end of the ball. It is linked by the same linear (matrix) mapping, but with one additional contribution: the ball can also spin like a top. This does not directly interact with the movement but is neverthess important. $$\pmb{\tau}_\mathrm{slide} = R\cdot\left(\begin{smallmatrix}\mathbf{e}_x\\\mathbf{e}_y\\\mathbf{e}_z\end{smallmatrix}\right)\left(\begin{smallmatrix}0&-1&0\\1&0&0\\0&0&0\end{smallmatrix}\right)\left(\begin{smallmatrix}\mathbf{e}_x\\\mathbf{e}_y\\\mathbf{e}_z\end{smallmatrix}\right)\mathbf{F} + \mathbf{e}_z\:\eta_\text{spin}\omega_z.$$