You need a tensor for a generic solution. but the "specialized" solution here is that you have a a spin only if you have friction in your contact. otherwise of course the contact forces will purely be directed to the center of the circle and never cause spin. if you have friction, your forces will start to deviate within the realms of the friction cone, which is then, not-anymore-center directed. This contact force will work against the inertia of your circle that applies at the center of mass. Both forces create a couple, which is a torque. this torque is determined is classical analytic mechanics using a cross product of the force vector and the lever vector.
From memory, the reduction of force in a point (to find a net force (or resultant) will give you a 2-components force, a force and a torque, directly. You "just" have to create a segment vector that links the center of mass to your contact point (subtract points
A-B=BA) and then cross-product it with your contact force, you get the torque component. This is the "lever effect". You can see that the more orthogonal the force gets, the greater the torque, or the farther away the contact is, the greater the torque. The 1st component is just a copy of the linear force.
You can treat your contact as an impulse if it is supposed to happen in only one simulation frame. Also you can consider about 2 possibilities for the colliding stick:
- infinitely heavy (because handled by some infinitely powerful virtual hand ?)
- or free, like the circle, and then the amount of energy transmitted in the circle will have to be determined by "momentum" repartition
p=m*v (momentum="quantity of movement").
link for this here: http://www.physlink.com/Education/AskExperts/ae462.cfm
F = m * v/t
For you it means diving by your simulation dt because the contact is instantaneous, and this creates the impulse.
The rotation will not happen directly as a result of the torque you calculate, there is the equivalent in rotation to the linear inertia, which is called angular inertia.
linear inertia is given by the mass, simply. This is natural to understand why because that's what happen with movement forumlas (from Netwon's
The mass is resisting the force applied to give birth to an acceleration.
In rotation, it is the same, the moment of inertia, is resisting the torque to create a spin.
One can find the moment of inertia by integrating the elements of surface over the shape (called second moment of mass), which for special shapes you can find pre-calculated on internet. for example for your circle you could say it's a cylinder and use
And the final touch is given by
torque = I * alpha which is
f=ma written in rotation form, so you know the torque because you calculated it using the cross product afore-mentioned, you know
I because it is
1/2 mass radius squared and so you know alpha: (
alpha = t/I) which is the angular acceleration, so then you just have to integrate over time to get the angular speed and finally angle after a second integration. (using Euler, Verlet, or Runge kutta, whatever).
About the concern of contact point being infinitely small and not capable of having friction: this is unrelated to the cinematic study, we can perfectly sanely infer that friction exists without any more justification. If in need for justification then you can imagine sticking a needle on a glass panel, this doesn't slip perfectly, it slips but has some amount of friction.
Also if you accept imagining that molecules can intertwine even a micro contact will be enough to get forces laterally transmitted. This especially happens easily on cold materials. (cold = less movement, thus more opportunities to fall in holes. imagine a rotating fan, if you push on it you can't go through, but if it is off, you just have to stick your finger in between the wings)
ODE creates temporary linkage in case of contacts, in this case it would create a ball joint during the simulation dt.
nice sum up here of linear / rotational parallels: