Dec-10-2019, 04:38 AM
Hello, hope this is the right forum for this question.
I'm generating star systems for a game and I could use some suggestions on the math.
I'm placing a star, then planets and using the distance (in pixels) to calculate surface temperature for the planets as follows:
Never been good at math, not sure if formula is right. If the formula is correct then I need to add a modifier of some sort, but I don't know if just using a fraction of the distance or multiplying the end result will throw of of the overall ratio.
Right now I'm using a screen that is 600X600 and distance is measured from the star at the center.
Any input would be nice. It's not going to break my game or anything, but if I use better math it will be nerdier.
I'm generating star systems for a game and I could use some suggestions on the math.
I'm placing a star, then planets and using the distance (in pixels) to calculate surface temperature for the planets as follows:
self.surface_temp = round((1/self.dist**2)*star.temp, 3)my outputs are like this:
RED DWARFS PlanetTemp= 0.158 StarTemp= 4000 Dist= 159 PlanetTemp= 0.292 StarTemp= 4000 Dist= 117 PlanetTemp= 0.071 StarTemp= 4000 Dist= 238Temp is in Kelvin and as you can see, these results are WAY too cold. (Pluto is about 44K)
Never been good at math, not sure if formula is right. If the formula is correct then I need to add a modifier of some sort, but I don't know if just using a fraction of the distance or multiplying the end result will throw of of the overall ratio.
Right now I'm using a screen that is 600X600 and distance is measured from the star at the center.
Any input would be nice. It's not going to break my game or anything, but if I use better math it will be nerdier.