The formation of the solar system began with the creation of the sun after an exploding supernova caused spherical accumulation of dust particles and gas in a huge swirling cloud called nebula. Planets and other components of the solar system formed in the flat plane of the rotating disc of dust.
The accumulation of dust particles some 4.5 billion years ago triggered a chain reaction. The center of the cloud attracted more dust as its gravitational force soared. The cloud increased its speed of rotation until it flattened into a disc rotating around a dense center. Temperatures at the core rose drastically as the cloud gathered enough energy to set off nuclear reactions. Eventually, the sun formed as hydrogen atoms joined to form helium, discharging huge amounts of energy in forceful eruptions.
The solar system formed two main groups of planets: the four rocky terrestrial planets closest to the sun and the four gaseous jovian planets farthest from the sun. The gaseous planets condensed at lower temperatures, hence their distance from the hot core of the solar system. The rocky and denser metallic materials formed the terrestrial planets because of their ability to condense at higher temperatures closer to the sun.