   Help making a 2d physics engine
  Hello All.My name is Adam.  I'm a scientist who is looking to construct a program for scientific simulation.  I'm not looking to make a game, per se.  This simulation is going to be like a game because it will have elements like collision detection and particle acceleration.  But this program will be used strictly for scientific research, namely medical studies.I've taken programming courses in college, but a feat like composing a physics engine was never covered.  Right now, I want to make a very simple program that does the following:1.  Creates an environment where one can click buttons to create circles of various sizes.2.  Using a GUI interface, one can inject small circles into larger circles.I've been looking for  tutorials to explain these tasks but have been having no luck.  Can some one help?  Trust me, if you can help, you'll be doing the scientific world a HUGE favor.  Thanks in advance.Adam   
  I would suggest using existing tools/libraries wherever possible and appropriate. A few questions:1. What programming language(s) are you comfortable with?2. What platforms are you targeting?3. What library or API do you intend to use for visualization?The two physics libraries that first come to mind are Box2D (which, as the name suggests, is intended primarily for 2-d applications) and PhysX. (Note that the containment of objects inside other objects may require some special handling.)Finally, any additional information you can provide about the application would be helpful. In particular, it would be useful to know how the 'injected' circles are supposed to behave with respect to the larger circles. (If the behaviors of the circles are simple enough, it may be something you could implement from scratch fairly easily.)   ;  I'm inclined to agree about using existing solutions rather than rolling your own. Physics, even in 2D, is hard. There's tons of edge cases, and you need not just programming expertise but a strong grasp of geometry and vector math. If you can get someone else to do the work for you, you'll be a much happier person. However, you might consider if you need physics at all.It sounds to me like you're looking to make something that will make animations or abstracted simulations of cellular biology (presumably for instructional purposes). I submit that you don't really need physics for such a simulation, beyond the most crude meaning of the word. Cells, after all, are three-dimensional, so it's OK if in your 2D view, objects pass in front of each other. If your goal was, say, to have a cell with a large cloud of molecules and a small number of proteins that "operate" on the molecules, you could represent both the molecules and the proteins as small circles that randomly walk around the interior of the cell (avoiding going outside simply by not choosing target destinations that are further from the center of the perfectly-circular cell than the cell's radius). Then if a molecule and a protein happen to bop into each other (using a simple radius test), they do their thing. There's not really any physics, in the sense of objects rebounding off of each other, deflecting at angles, and so on, but if you don't need that, then why bother? The above would produce a reasonably believable simulation of a cell at work, and that's all that really matters. The big secret of game development is that methods are irrelevant; it's results that matter. :)   ;  A lot depends on what you need these physics for.  Are they just so you can make a pretty presentation of your research, or do you need to accurately model the nature of the interaction between objects?  If you need accuracy Working Model 2D sounds decent (though I can't vouch for it myself).  If you are going for a pretty presentation and graphical representation of your work, you may want to look at Box2D or Chipmunk Physics.  Either way, it would help to know more about what physics you're simulating and what you need from those physical simulations.   