It has earlier been shown that the mass distribution within a group of econdary bodies (e.g., satellites) formed around a central body is a function of the rotational velocity of the central body. From a study of the satellite groups an empirical relation was derived, which makes it possible to find the rotational velocity of a central body when the mass distribution of the secondary bodies is known This result is applied to the terrestrial planets. It appears that when the Mercury-Venus-earth group was formed, the rotational period of the sun was about 20 days. As this agrees reasonably well with the present value, it is tempting to conclude that the terrestrial planets were formed after the giant planets, at the formation of which the sun lost most of its angular momentum. However, arguments are given for an alternative view, viz.,that the terrestrial planets were formed before the giant planets and that both processes took place when the sun was in the deuterium-burning state. If this alternative is accepted, we can calculate the present period of the solar axial rotation in good agreement with the observed value.