Day 2
Today, I went to my local hobby shop and bought some clay. After molding it into a ball and hardening it in the oven for 30 minutes, my sine quadrant is ready for measuring the altitude of celestial bodies!
The clay ball functions as a weight, and will hang parallel to the polar axis of my local horizontal coordinate system. I can then "aim" the upper edge of the quadrant at a celestial object I would like to measure the altitude of, such as a star, pin the thread's position with my other hand, and then read the angle that the thread is showing me. Again, take a look at The Astrolabe Project for a better explanation of how the sine quadrant can be used! Deconstructing the sine quadrant - Part 1
Spherical coordinate systems, a quick primer
But this is supposed to be a coding exercise, so why haven't I done any coding yet? In order to explain that, let's understand the problem that I'm trying to solve! At its core, there are three important spherical coordinate systems that I'm interested in. What follows is a layman's explanation of each.
Geographical
This familiar geographical coordinate system, using latitude and longitude, is one example of a spherical coordinate system. Here, the polar axis is the earth's rotational axis. The "polar angle" of this coordinate system is the latitude, since it can be described as the angle between the polar axis and a given position on the earth's surface. The "azimuthal" angle of this coordinate system is the longitude, since it describes a rotation around the polar axis. Half-circles that run from the north to the south pole are called "meridians". If two positions have the same longitude, they are on the same meridian. The greenwich meridian is used as the meridian where the longitude is zero, also known as the "prime" meridian. Since greenwich is a place on earth, geographical positions do not change as the earth rotates. The geographical positions of stars, however, will move as the earth rotates.
Equatorial
The equatorial coordinate system is similar to the geographical in that they both use the earth's rotational axis as the polar axis. However, the equatorial system should be pictured to extend beyond the earth's surface infinitely into space. In the equatorial system, latitude corresponds to "declination", and longitude corresponds to "right ascension". The crux of the equatorial system is that it does not use greenwich as the zero point for right ascension. Instead, a specific time during the year, the march equinox, is used to draw a line between the earth and the sun. The direction of this line is the zero point for right ascension. The benefit of this is that equatorial positions of stars do not change as the earth rotates, making it possible to catalogue these positions and look them up later.
Horizontal
This spherical coordinate system is used to describe observations of objects in the sky from a given point on earth. Its polar axis can be imagined as a line that runs from the center of the earth, up between your feet, and continues up through your local zenith. It is this coordinate system that is used when making local measurements of objects in the sky, such as the sun or a star. The angle between the horizon and the object is the polar angle and is called the "altitude" of the object. If you face directly north, almost exactly towards Polaris, the azimuthal angle of the object, called "azimuth", is zero. Turning eastwards from there will increase the azimuth until you've spun a whole circle back to north, where azimuth is zero once again. Using the altitude and azimuth, sometimes shortened as "alt-az", you can locate an object on your particular sky.
The problem of celestial navigation using stars can be simplified as follows:
- Observe the horizontal coordinates, primarily altitude, of a few known stars.
- Look up the equatorial coordinates of the observed stars in a star catalogue.
- Use the time of observation to derive the current rotation of the earth.
- Use all of the above to derive your geographical position.
There is plenty of linear algebra involved in this, which is what I would like to automate in as simple a manner as possible!
But in order to verify that the program works, I ought to be able to test it on actual observations.
Thus, this simple tool for the measurement of horizontal altitude was conceived!