Like most things in astronomy, it is determined indirectly.
Basically we determine the mass of the object through interactions with other objects
We determine it’s density through observations of it’s spectral signature.
Knowing the mass and density, we can calculate it’s volume and size.
The specific steps can vary depending on the type of object, but it always comes down to thsoe steps.
Latest Answers