Which of the following is true for both gas planets and terrestrial planets?