The Sun formed when a rotating cloud of gas and dust that was bigger than the present solar system contracted under the influence of its own gravity. According to conservation of angular momentum, as the cloud shrunk in size, its rotation period (i.e., the time needed to rotate once around its axis):