# Simple Solar Model

Here is a very simple tool to calculate the sun’s position in the sky. It uses a minimal model based on a few orbital parameters. Despite its simplicity, it makes predictions that are very close to more complete models.

The tool is inspired by a recent discussion I had with somebody who claims the world to be flat. He seemed otherwise sane but he genuinely believed modern science to be a lie.

I was shocked and upset for days. Not only is it a rejection of our amazing technological progress but also it represents a failure of science and engineering education.

He makes use of modern technology: he has a phone with GPS. GPS is based on timing information transmitted by satellites orbiting our round planet. Claiming the world to be flat while using GPS is as absurd as an airline passenger claiming that heavier than air flight is impossible.

However, I feared that it would be unfair to dismiss it entirely out-of-hand. Suppose it all is a lie, would I even know? I haven’t personally built a GPS receiver. Things like GPS could be purely terrestrial: the satellite-based specifications and home-made GPS receivers might be elaborate diversions.

Even though I make use of physics in my work, I hadn’t previously verified planetary-scale models.

### Testing the Theory

Fortunately, anyone can test the theory. You just need to simultaneously phone two trustworthy friends in different cities. Each person reports the angle of the sun. From there, triangulate the sun’s position to discover that a horizontal plane does not fit the data.

For example, at 12:21pm (local time, UTC+10:00) on 22 December 2015 in Longreach Australia, the sun was directly overhead. At the same time, in Sydney (1343 km away) the sun was at an elevation of 78 degrees. After triangulating, it can be calculated that the sun should be at 34 degrees in Delhi (9211 km away) if the world were flat. However, the true elevation in Delhi was just 7 degrees.

In fact, you don’t even need to phone two friends. Instead, I decided to use data from existing observations (that’s where the example above comes from). There are thousands of books and websites with forecasts and records of solar noon, sun azimuth/elevation, sunset, sunrise. This data is validated by millions of ordinary people each and every day. I regularly use them at home and while traveling to find the time of sunset and solar noon. Architects use them to draw shadow diagrams. For centuries, sailors have used such data to navigate. Sailors, pilots and military personnel still learn to navigate with the data today. Solar data is used to create sundials and to set the angle of electricity-generating solar panels.

Therefore, using a (nearly) spherical model to generate the sun position data is like enlisting millions of people to perform a massive triangulation experiment.

To verify the solar data, I created a planetary model in JavaScript. The code of the tool is very simple. The key function is `rotateEarth`. It combines a series of rotations. First it takes a latitude and longitude, then rotates the planet once per day, and finally tilts 23 degrees (for the Earth’s axis). After this, a `sunVector` function computes the position of the sun based on the Earth’s orbit. Earth’s orbit is nearly circular. Assuming a circular orbit gives a rough approximation. However, using an elliptical orbit with Kepler’s equations gives a more precise result. There’s a lot that could be done to improve the code but it is enough for my purposes.

Astronomy has a lot of specialized terminology that I initially found intimidating. Most of my time writing the code was looking up the meaning of technical terms. However, the underlying principles are straightforward. Everything is clearly explained on Wikipedia. It just takes some patience to work through step-by-step.

### Conclusion

No surprises. The spherical model is what fits the data! The world is round. Not only that, ordinary people (such as myself) can readily verify it.

Phew!

Published 8 January 2016 by Benjamin Johnston.