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

Slowing down Wall Street

Wall Street, lately, has been using high-speed trading to allow insiders to front-run trades by ordinary investors. So, for example, when an outfit like TIAA-CREF (pension funds for teachers) tries to place an order to buy shares of a company they like, other investors’ computers can detect the trade before it happens, buy the shares, … Read more

The Vincenty great-circle distance formula

This Vincenty formula is a more numerically stable version of the spherical cosine law formula (commonly and wrongly known as the Haversine formula) for computing great circle distances. The question of numerical stability comes up specifically when the distances between points are small. In those cases the cosine is very close to 1, so the … Read more

Stored function for haversine distance computation

In another article I described the process of using MySQL to compute great-circle distances between various points on the earth then their latitudes and longitudes are known.  To do this requires the formula commonly called the haversine formula. It’s actually the spherical cosine law formula, and is shown here. There’s a more numerically stable formula — … Read more