Physics : _rotation based on collision

Hello,

I’m looking for some code/physics theory that give an object rotation based on how far the collision is from the objects center of gravity.

A square falls from the sky, and hits the ground at an angle, right on one of the square corners. The spin would be large, but if the square hit the ground flush on an edge, the spin would be less. Does that make sense?

Thanks.