Hi,

So I'm making a physics engine and I'm having trouble calculating the net normal force of an object that is in touch with many other objects (it works for 2 but doesn't work for more). The scenario is a circle is between two other circles (ontop of them, in the middle) and there are more circles on top of that circle. There's also gravity acting on the circle. Right now the way im calculating the net force on the object is first I apply gravity to it, then I apply the normal force from the first object in contact and get a new net force, then I apply the normal force from the second object to the net force and get a new net force, and etc... However I'm not sure if what I'm doing is correct. Is this the way to do it or is it wrong?

Thank you