How to calculate the ratio of two perceived object sizes based on distance and actual size? Let's say we have 2 objects on the sky: The Moon and Jupiter
Jupiter is much larger obviously, but we perceive the Moon to be bigger because it's closer to us. We know everything about them, actual distance and actual size. 
How can we calculate how big does the Moon appears to be in relation to Jupiter? (So, the ratio of the perceived size)
 A: This perceived size is also known as the angular diameter. The basic idea is that to measure something, you look at the isosceles triangle whose vertices are your eye, and two points on (the edge of) the object:

If the object has an actual diameter of $D$ and is distance $r$ from your eye, then the angle $\alpha$ is a nice way to measure the perceived size of something.
Cutting the (isosceles) triangle in half, we have that $\tan (\frac{\alpha}{2}) = \frac{D/2}{r} = \frac{D}{2r}$, so that $\alpha = 2 \tan^{-1}\big(\frac{D}{2r} \big)$
For two objects, just give everything subscripts; angular diameters $\alpha_1$ and $\alpha_2$, actual diameters $D_1$ and $D_2$, and distances $r_1$ and $r_2$ from the observer. Then setting up the ratio and simplifying a bit,
$$\frac{\alpha_1}{\alpha_2} = \frac{\tan^{-1}(\frac{D_1}{2r_1})}{\tan^{-1}(\frac{D_2}{2r_2})},$$
is the ratio in apparent sizes.
Just for fun, if the moon is our first object, its diameter is $D_1 \approx 3474\ \text{km}$ and is an average distance of $r_1 \approx 384{,}402\ \text{km}$ from us, for an angular diameter of $\alpha_1 \approx 0.259^\circ$.
Meanwhile, for Jupiter, $D_2 \approx 142{,}984\ \text{km}$ with a closest distance of  $r_2 \approx 588{,}500{,}000\ \text{km}$ for an angular diameter of $\alpha_2 \approx 0.00696^\circ$.
Thus, the moon appears to us about $\frac{\alpha_1}{\alpha_2} \approx \frac{0.259^\circ}{0.00696^\circ} \approx 37$ times as big as Jupiter!

I compared this ratio to the image on this website (and one more, to check), showing our Moon and Jupiter in the same shot. Unfortunately, using MSPaint to measure diameters, the ratio looked closer to $33$, rather than $37$. Using the furthest distance the Moon gets, the calculated ratio is a bit better, $\approx 35$. Anyway, you get the idea.
