N-body problem: Difference between revisions

m
Corrected grammar
m (Corrected grammar)
Line 279:
 
====Graphics====
One of the golden rules of Physics : Draw a diagram. It doesn't have to be artistic, but a properly drawn diagram whose proportions are realistic simplifies the solution of almost every Physics problem. That was the case with this task as well, when I first ran the console version, I noticed that Body 1's position and velocity isare varying wildly. I put it down to the chaotic nature of the system and got busy writing the Graphics part and it's when I found that nothing was being drawn on the screen, I took a good look at the implementation and discovered many glaring mistakes. Gravitation is an attractive force, it never repels ( we will talk about [https://en.wikipedia.org/wiki/Dark_energy Dark Energy] later). When I saw the particles moving away from each other, I knew the acceleration vector had the wrong sign.
 
----
503

edits