Friday, January 17, 2014

On... a fifth arbitrarily defined solar cycle?


It's hard to believe that the Earth has completed almost five trips around the sun (at least, it will have by 19:44 this evening) since I started this blog, one boring Saturday afternoon in 2009. Although I have been considerably less active over the past year, I still managed to find time for 18 posts. I had just under five thousand visits this year (although Blogger is reporting forty thousand for some reason), mostly from the US, South Africa, Canada and the UK. It's difficult to tell what Google searches bought people here, because Google no gives out that information for users who are signed in. It's mildly disappointing, but I'm actually glad that the world is taking privacy a little more seriously these days.

The most popular posts for the year were, well, from previous years actually. My post about petrol price hikes made it into sixth place, after four posts about Minecraft, and the post from 2011 about our Tullen Shears (which, incidentally, are still going). Other popular posts for the year include Amusing Hat Day (which was a bit of a flop - even I forgot my hat), and the posts about classical music (lots of links to a couple hours worth of music, so go listen if you haven't already), the age of star light, and the theory of relativity. I was disappointed that my first video game was not quite as successful (go download it and try it if you haven't. It's actually more fun than it sounds).

Outside of blogging, 2013 was a very eventful year. On the academic side, I actually made some serious progress toward my PhD (despite both a hard drive and a laptop deciding to retire, removing 700GB of simulations between them), and may actually finish it soon, and I was flown to the other side of the world (the USA) to present a paper at my third academic conference. I bought my first car (instead of just driving a car which technically belonged to my parents), and took out my first insurance policy. I think, somewhere during 2013, I turned into an adult. I'm still not exactly sure what that means, and I don't feel any different, but I'm sure I'll figure it out.

Anyway, hopefully I'll still be able to find some time to post for some years to come.

If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



Monday, January 13, 2014

On a Sense of Scale in the Solar System


Cary Huang has an awesome Flash application that you might have seen before, called The Scale of the Universe. Although that app is awesome for getting a sense of the sizes of various objects, it is not very good at conveying a sense of distance. To convey a sense of size and distance, you need to portray both sizes and distances to scale, like the Earth and Moon in the image below. I've always wondered if I could make something that can convey that sense of distance.


Figure: The Earth and Moon with both sizes and distances to scale. [Source: Wikipedia]

I've been wanting to learn how to use HTML5 canvases and improve my JavaScript knowledge for a while, so I realised that this was a perfect opportunity to do that. On Christmas Eve 2013, I sat down and began to program it.

Here is what I came up with.


It's probably not complete, but an app like this could be added to forever, and it possibly will be. I'd like to go further than our Solar System, and add some neighbouring stars, the Milky Way Galaxy and it's neighbours, and so on, until I get to the observable universe.

The rest of this post will talk about the challenges I faced during development, so if that sort of thing doesn't interest you, you can move on. If it does, or you're bored enough not to care, then please read on.

Firstly, the distances between objects in our Solar System are just enormous relative to the sizes of those objects. For example, to display the Earth and Sun together in an image, with the sizes and distances to scale, the image would have to be well over eleven thousand pixels across for the Earth to even show up as a single pixel. That's six times the resolution of a widescreen monitor at 1080p.
The second problem is the range of orders of magnitude that need to be dealt with. Many moons in the solar system have diameters of just a few hundred kilometres and orbit tens or hundreds of thousands of kilometres from their planets, yet the gas giants orbit at distances of a few billion kilometres from the sun.

Thirdly, there is the shear number of bodies in our solar system. The four gas giants have a couple hundred moons between them, and there are more than half a million bodies in our Solar System actively being tracked by the Minor Planet Center.

Finally, the orbit of each body in our solar system traces a unique path in three dimensional space, each with a different inclination, eccentricity, and other orbital parameters. Each body is at a different position in it's orbit, and many of these orbits (especially bodies in the outer solar system) intersect. For example, although Pluto is currently further from the sun than Neptune, it was actually closer than Neptune between 1979 and 1999.

The solutions described below were applied to solve the above problems, in reverse order. Each of these solutions has implications, which are also described below.

The program was restricted to a single dimension. Inclinations were ignored, and distance of each body is averaged across its entire orbit. The implication of this is that all bodies are incorrectly shown on the same plane, and distances between each body are completely inaccurate. Only the average distance from the body to the planet or star about which it orbits is accurate. A future incarnation of the program may remove this restriction.

All eight major planets were included, but only the five dwarf planets recognised by the IAU at the time of writing were included. This means that some bodies such as Sedna, Quaoar, Orcus and Salacia were not included, even though they are widely considered by many astronomers to be dwarf planets. Moons are only included if they are either massive enough to be rounded under it's own gravity, or larger than 10% of their parent planet's diameter. There are only two exceptions: Mars's moons Phobos and Deimos. These were included because they are widely known, and are the best studied moons in our solar system other than our own.

The ability to zoom was essential in order to get a sense of scale over a wider range of distances, with orders of magnitude varying from as little as tens of kilometres up to trillions and beyond. A constantly scaling grid in the background is essential for maintaining the sense of distance as the scale changes.

A minimum size (currently 3 pixels) had to be enforced so that a bodies position could still be seen, even when zoomed too far out for it to be visible. Bodies gradually fade from view as they get too close to their parent bodies on the screen.

I think the final approach comes close to what I originally imagined when I originally came up with the idea, and I hope someone at least finds it interesting and educational.

If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .