Ok, hist of sci people out there, help me out:

In Hilchot Yesodei Hatorah chapter 3, Maimonides lays out the geocentric model of the cosmos, epicycles and all. At 3:8, he notes that Earth is about 40 times larger than the moon, the sun is about 170 times larger than Earth, the sun is the largest of the "stars" (a category that includes planets too), and Mercury is the smallest. Comparing this with the actual data we know now, the sun is of course larger than any of the planets, and Mercury is the second smallest of the heavenly bodies known at that time (the moon is smaller). The sun's radius is 109 times Earth's radius, so the Rambam's number is pretty decent, within a factor of 2. Earth's radius is 3.67 times the radius of the moon, so that figure is considerably further off (by an order of magnitude). The ratio of Earth's volume to the moon's volume is 49, much closer to the Rambam's number of 40 (and he doesn't actually specify which dimension he's talking about), though if we understand the Rambam's ratios to be about volume rather than linear dimension, then the sun-to-Earth ratio is thrown way off.

So my question is this: HOW THE HECK DID HE KNOW? (And by "he", I mean the Rambam himself, or ancient Greek astronomers, or medieval Arab astronomers, or wherever he's getting his data from.) Even if the moon number is considerably further off than the sun number, it's still an impressive feat to know that the moon is smaller than Earth (by any amount) even though the sun is much larger (by an amount that he basically got right) and the sun and moon are the same apparent size in the sky. He knew that the sun was farther away than the moon (which can be reasonably inferred from the sun's (apparent) orbital period being longer), which would mean that the sun is larger than the moon if they're the same apparent size, but it's not clear how he got any sort of quantitative relationship between those sizes (the ratio he gives between the sizes of the sun and the moon doesn't have any obvious mathematical relationship to the ratio of their orbital periods), let alone how he could compare either of them to the size of the Earth. (Did he have some version of Kepler's Third Law?) I know that Eratosthenes measured the circumference of the Earth, but did pre-modern astronomers have any sense of how far away the sun or other celestial bodies were? And as for the sizes of the planets (the ones we would call planets, not the sun and the moon), how could anyone resolve any finite sizes, rather than just seeing them as points of light? I can't blame him for thinking the moon is larger, but how did he know that Mercury is smaller than Venus, Mars, Jupiter, and Saturn?

Pardon me if these questions are ignorant; I would be fascinated to know the answers. Thanks!