I have a relatively simple case that I'm bending my head around for quite some time already, I'm trying to evaluate by hand (without the use of any libraries) the rotational and linear velocities for a 2d square and a ball after collision with a wall.
Given that:
r - is either radius or side length of the square
X1 - is a vector of initial position for a given rigid body
V1 - is a vector representing initial velocity of a given rigid body
R1 - is an initial rotational velocity of a given rigid body
W1 and W2 - are vectors representing position of a wall ends
C - is a vector representing point of collision
X2 - is a vector representing position for a given rigid body at the moment of contact with the wall
V2 - is a vector representing resulting velocity of a given rigid body after contact
R2 - is a rotational velocity of a given rigid body after contact
I understand that I might be lacking some parameters such as mass, damping, friction or properties describing the material of the wall but I leave that to the person answering the question since there are different models possible.
I'm in progress with a book "Apress Physics for JavaScript Games Animation and Simulations With HTML5 Canvas" by Dev Ramtal and Adrian Dobre, but this topic is very wide, shredded and sparse. So it's hard to get a simple definitive answer how such collision is being resolved.