0

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

Deepak Kamat
  • 103
  • 3
  • 1
    Scaling implies that the ratio should be the same everywhere, hence dividing by $27828$ is probably what you want, even though I guess you will end up with sub-pixel values.

    The other alternative is to take into account the fact that most other planets are far more distant from us than the sun is, which would involve Thales' theorem and result in even smaller values.

    – Arnaud Mortier Feb 13 '18 at 15:26

1 Answers1

2

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.

Ross Millikan
  • 374,822
  • Hi @Ross, I am yet to try this out, but of course, I am confident about this, and I will try it out.

    Yes, that's the same concern I'd, and currently all I cared about is getting the basic math done, the 50px I am using right now is just for the test, actually I will just change it to a lot bigger number so the smallest planet can be at least a pixel. And the users will of course have to do a lot of x axis scrolling to see all the planets.

    – Deepak Kamat Feb 13 '18 at 15:32
  • @JaapScherphuis: that is correct. I updated – Ross Millikan Feb 13 '18 at 15:47
  • @DeepakKamat: the problem is that the planet sizes are so small compared to the distances between them. You really can't show both at the same scale. The math is simple division, but the resolution of our display devices just isn't there. Even worse than earth is Neptune. It is four times the diameter but $30$ times as far from the sun. – Ross Millikan Feb 13 '18 at 15:50