Having used parallax to calculate the distance to a planet, we can use simple trigonometry to determine its size. First we measure the angular width of the planet theta_w.
picture ANGULAR WIDTH OF PLANET
We already have the distance D. The planet has radius r.
$$ \tan \frac{\theta}{2} = \frac{r}{D} $$
Radius r of the planet
$$ r= D \tan \frac{\theta_w}{2} $$
The volume V is given by
$$ V = \frac{4}{3} \pi r^3 $$
picture: Orbital distance of a moon
Determining the distance the planet's moons is done in the same way. First wait for the moon to be at right angles to the planet, then measure the angular separation from the centre of the planet to the centre of the moon. This angle is called the "elongation". Then
$$ r= D \tan \theta $$
Where D is the distance from Earth to the planet, theta is the angular separation.
First we measure the time for the moon to go from its original position until it returns there.
$$ v = \sqrt{\frac{GM}{r} } $$
$$ vT = 2 \pi r $$
$$ T = \frac{2\pi r }{\sqrt{GM/r} } $$
$$ T = \frac{2\pi r^{3/2}}{\sqrt{GM} } $$
Rearranging to get mass M of the planet:
$$ M= v^2 r /G $$
$$ M = (2 \pi r /T)^2 r/G $$
$$ M = \frac{4 \pi^2 r^3 }{(GT^2)} $$
Thus we can calculate the mass of a planet such as Jupiter by observing the orbital period of its moons.
And from there, we can calculate the density. We know the volume of the planet and its mass, and its average density is
$$ \rho = \frac{M}{V} $$
We will calculate the volume, mass and density of Jupiter and Saturn in another section.