I am creating a scale model of the solar system for a personal website project and I am now stuck with the basics math for it. I have been banging my head against the wall trying to get things right but nothing beats being so poor at math.
So, all I am stuck at is scaling down the values, from gigantic values to mere unit of pixels.
The sun's diameter is 1391400 (km), I am scaling it down to 50 (pixels). Dividing these two numbers I get 27828 - I know this number is going to be useful in scaling down other values such as the distance between the sun and earth, which is 149,600,000 (km).
Now I am not even sure where to go from where, do I divide any number that comes up with 27828? I guess not, a voice in me is saying that is drastically wrong and isn't what I want.
I will give you basic values that I've with me,
1391400 scaled down to 50. 57910000 (distance from Sun to Mercury) 108200000 (distance from Sun to Venus) 149600000 (distance from Venus to Earth)
Please help me, I am totally banging my head on this.
If you know basic JavaScript and HTML, you can take a look at what I am trying to create: https://codepen.io/depy/pen/WMENyZ?editors=0010
Yes, you have determined that the scale factor is $27828 \frac {\text{km}}{\text{pixel}}$ so you should divide any value in km by $27828$ to get the number of pixels. The earth would be $\frac {12742}{27828}$ pixels in diameter, which is about $\frac 12$ of a pixel. How will you show it? Its distance to the sun would be $\frac {149\ 598\ 000}{27828} \approx 5376$ pixels. At a screen resolution of $72$ pixels per inch that is almost $75$ inches. I hope you have a big monitor. Space is big.