Using the Hipparcos catalogue, I am trying to create a celestial sphere. As all the stars are a fixed distance from the centre of this sphere, the only way to differentiate the distances and magnitude is through the sizing of each model of the star.

With the Parallax angle $p$ and visual magnitude $m_{vis}$ of each star from the catalogue, I have created the code below to calculate the radius of each star relative to the radius of the sun. I had used this website to calculate this. The problem is that some stars are too big, almost bigger than the celestial sphere itself! I am trying to keep the radius below a certain threshold.

Here $p$ is in arcseconds and $d$ is in parsecs.

$$d = 1 / p$$

$$M_{abs} = M_{vis} - \log_{10}(d^5) + 5$$

$$ T_{surf} = \frac{8540}{CI + 0.865}$$

$$R_{rel} = \left( \frac{5800}{T_{surf}} \right)^2 \sqrt{(2.512)^{4.83 - M_{abs}}}$$

$$R_{Sun} = 2.5$$

$$r = R_{rel} R_{Sun}$$

    private void positionStar()
        double radius;
        gameObject.transform.position = cartesianPositioning;

        // Convert Plx from milliarcseconds to arcseconds (seconds of arc)
        double PlxSOA = Plx / 1000;
        // Calculate distance from equation d=1/p
        // distance d is measured in parsecs and the parallax angle p is measured in arcseconds.
        double dPC = 1 / PlxSOA;

        double absMag = Vmag - math.log10(math.pow(dPC, 5)) + 5;

        surfaceTemperature = 8540 / (CI + 0.865);

        double relativeRadius = math.pow((5800 / surfaceTemperature), 2) * math.sqrt((math.pow(2.512, (4.83 - absMag))));
        double radiusSun = 2.5f;

        radius = relativeRadius * radiusSun;

        gameObject.transform.localScale = new Vector3((float)radius, (float)radius, (float)radius);

First of all, am I using the right mathematics? If I am, then how can I make sure that the radius is below a certain maximum threshold (5 units, for example.)?

If the mathematics is incorrect, please assist me on how to fix it.


With a slightly modified version of @Mike G's formula in their answer below:

r(m) = 50 * 10^{(-1.44 - m) / 5}

radius = 50 * math.pow(10, (-1.44 - Vmag) / 5);

I was able to get this result: Star Field

And if I'm not mistaken, I think I can locate the Ursa Major constellation offset slightly to the left from the centre of the screenshot.

However, after uploading to nova.astrometry.net the stars and constellations are still not being picked up. Is this because the star sizing is still a bit incorrect or is this issue on the website's side?

I can use another website/app such as Stellarium to cross-check, is there a way the app can process an input image or do I try to recreate using my image on the app?

  • $\begingroup$ I've done my best to convert your computer code to readable equations using MathJax. Please double check it. $\endgroup$
    – uhoh
    May 31, 2020 at 22:24
  • 1
    $\begingroup$ @uhoh, looks great, thank you! $\endgroup$
    – SidS
    May 31, 2020 at 23:09
  • 1
    $\begingroup$ This is totally confused. Your question asks about plotting stars according to their radius, but now you seem to want to plot them with a size correponding to their brightness. The two are only indirectly related and brightness does not involve the parallax at all. $\endgroup$
    – ProfRob
    Jun 1, 2020 at 13:44
  • $\begingroup$ In @Mike G's answer, they talk about how it is much simpler to base the stars' radius with the apparent magnitude instead - this is why I have taken this route. However, if there's a simpler route to incorporate their actual radius and also make all the stars uniformly sized, then I will explore it further. I will change the title of the question to make more sense $\endgroup$
    – SidS
    Jun 1, 2020 at 13:49
  • $\begingroup$ Looking better! I recognize a few other constellations too, but they're mirror-reversed. Also math.pow(math.E, x) == math.exp(x). Consider adding more light sources, increasing the ambient term, or using an emissive material. $\endgroup$
    – Mike G
    Jun 1, 2020 at 16:56

2 Answers 2


Your maths looks ok, bar the fact that $1/$parallax is a biased estimate of the distance (but that can be forgiven so long as you are using data where the parallax uncertainties are much smaller than the parallax).

Your main problem is that stars do indeed have a vast range of sizes. Thus if you really do want to show the relative sizes of the stars you have a dynamic range problem.

The conventional way to deal with this would be to use a logarithmic scale, such that each increment in size corresponds to a multiple of the one below. e.g. Make your plotted radii proportional to $\log_{10} R_{\rm rel}$.

EDIT: In response to altered emphasis of question.

It seems you no longer want to scale the stars according to their actual radius, but rather according to their brightness. The logarithmic scaling is therefore already handled by the apparent magnitude (which is on a logarithmic scale).

Therefore all you need to do is decide what your smallest and largst radius are and compare that with the brightest and faintest magnitudes you want to plot.

e.g. If your biggest star is 5 units and your smallest is 0 units, and your bright and faint limits are $m_{\rm bright}$ and $m_{\rm faint}$ respectively, then the size of an arbitrary star of magnitude $m$ is $$ r =\frac{5(m -m_{\rm faint})}{m_{\rm bright} - m_{\rm faint}} \ .$$

And if you want your faintest stars to be size 1 and brightest to be 5, this modifies to $$ r =\frac{4(m -m_{\rm faint})}{m_{\rm bright} - m_{\rm faint}} +1 \ .$$

Yet another alternative would be to make the area proportional to magnitude. Again, scaling between radii of 5 and 1:

$$ r^2 =\frac{24(m -m_{\rm faint})}{m_{\rm bright} - m_{\rm faint}} +1 \ .$$

  • $\begingroup$ Minimum size should be nonzero, and a linear function of m is too steep at the dim end. $\endgroup$
    – Mike G
    Jun 1, 2020 at 18:20
  • $\begingroup$ @MikeG Your solution just scales as square root of flux and goes down by a factor of 1.6 for every magnitude! Minimum size can be set to whatever you like by adding a constant. Mine scales linearly with magnitude which is how the eye works. $\endgroup$
    – ProfRob
    Jun 1, 2020 at 18:37
  • $\begingroup$ With the second formula, r(0) / r(1) = 1.15, and r(5) / r(6) = 1.54. $\endgroup$
    – Mike G
    Jun 3, 2020 at 14:55

The SDSS exercise shows how to estimate a star's actual radius. If you use this radius, you should also use different model materials for different color index values, since luminosity per unit area is a function of temperature. If you prefer to avoid that complexity, base your model stars' radii on visual magnitude alone. If you put the model stars at a uniform distance from the observer, use apparent magnitude instead of absolute magnitude.

Suppose your celestial sphere radius is 1000 units, and you want Sirius (apparent magnitude mmin = -1.45) to have an apparent angular radius of 5 milliradians. Then the Sirius model radius rmax would be 5 units, and a star of apparent magnitude m would have model radius $$\begin{align} r(m) &= r_\mathrm{max} \times 10^{(m_\mathrm{min} - m)/5} \\ &= 5 \times 10^{-1.45 / 5} \times 10^{-m/5} \\ &= 2.6~e^{-0.46~m} \end{align}$$

If you also wish to set a minimum star model radius, try r(m) = beam where $$\begin{align} a &= \frac{\ln r_{\mathrm{min}} - \ln r_{\mathrm{max}}}{m_{\mathrm{max}} - m_{\mathrm{min}}} \\ \\ b &= r_{\mathrm{max}}~e^{-a~m_{\mathrm{min}}} = r(0)\\ \end{align}$$

For example, to get r(6.0) = 0.5 with r(-1.45) = 5 as above, you could use $$ r(m) = 3.2~e^{-0.31~m} $$

These model radii are nowhere near reality but should produce a recognizable night sky. In real life the Sun's radius is about 2.3×10-8 pc.

  • $\begingroup$ what does the m subscript min stand for? $\endgroup$
    – SidS
    May 31, 2020 at 23:06
  • $\begingroup$ @SidS The apparent magnitude of the brightest star. $\endgroup$
    – Mike G
    May 31, 2020 at 23:32
  • $\begingroup$ I've implemented a slightly modified version of this equation - the result looks amazing, however, astronomy.net is still not able to detect the stars and constellations. Please refer to the edit that I've made to the question for more details. Thanks! $\endgroup$
    – SidS
    Jun 1, 2020 at 13:23
  • 1
    $\begingroup$ The Hipparcos catalogue has stars between apparent magnitudes -1.4 and 8. Your radii would be from 5 to 0.06 (or 0.16 at 6th mag). Contrary to the comment you attached to my answer, your prescription is too steep at faint magnitudes (and squared if you think the area is what represents apparent brightness), mine is much shallower. That is why it is hard to recognise constellations that are typically defined by stars having a 3-4 mag range. In your scheme this is a range of 16-43 in spot area. $\endgroup$
    – ProfRob
    Jun 1, 2020 at 20:22
  • $\begingroup$ @RobJeffries Added a minimum radius parameter while preserving r(0)/r(1) = r(5)/r(6). $\endgroup$
    – Mike G
    Jun 1, 2020 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .