I'm working on a multitouch-based interface and I want to add some physical behavior to gestures (pan, zoom and rotation). I thought model the system like that:
- When a touch starts, a point mass is created.
- As the finger moves, I calculate it's velocity vector.
- When the touch ends, I suppose the mass is released and starts to move freely.
My problem comes when I have two masses (I don't need more than two masses to model this system):
The masses should act as if they were connected by a massless rod and, optional, they can slide along the rod with some coefficient of friction.
I attach a picture to explain the thing better.
I forgot almost all the physics I knew at college and now I'm a developer.
I know that at time t the masses have a position (x, y), a velocity and one or more forces or accelerations acting on it. And I want to know those values at time t+dt.
I would like to have some advice or approach to this problem. It's not about integrators or numerical analysis. My main doubt is about the rod constraint (keep the distance between masses) and the rotation movement.