Computing an initial bearing

This MySQL Stored Function computes the initial bearing — the compass heading to follow — when moving from one point to another on the surface of the earth.  Here’s a web site describing this. http://www.movable-type.co.uk/scripts/latlong.html