Recall the First Spherical Law of Cosines:

Given a unit sphere, a spherical triangle on the surface of the sphere is defined by the great circles connecting three points $latex u$, $latex v$, and $latex w$ on the sphere. If the lengths of these three sides are $latex a$ (from $latex u$ to $latex v),$ $latex b$ (from $latex u$ to $latex w),$ and $latex c$ (from $latex v$ to $latex w),$ and the angle of the corner opposite $latex c$ is $latex C,$ then $$\cos c = \cos a \cos b + \sin a \sin b \cos C$$

In any decent device and for most computer languages, this formula should give well-conditioned results down to distances as small as around three feet, and thus can be used to compute an accurate geodetic distance between two given points in the surface of the Earth (well, ok, assuming the Earth is a perfect sphere). The geodetic form of the law of cosines is rearranged from the canonical one so that the latitude can be used directly, rather than the colatitude, and reads as follows: Given points $latex p_1$ and $latex p_2$ with positions $latex (lat_1, long_1)$ and $latex (lat_2, long_2)$ respectively, the distance $latex d$ between the two points is given by the following formula.

$$ \cos\displaystyle{\frac{d}{R_\oplus}}=\sin(lat_1)\sin(lat_2) + \cos(lat_1)\cos(lat_2)\cos(long_2-long_1),$$

where $latex R_\oplus=3,959$ is the radius of the Earth in miles (well, ok, the average radius of the Earth…)

A nice application of this formula can be used for geolocation purposes, and we recently had the pleasure to assist Thumb Mobile to write such functionality for one of their clients.

Go to in your mobile device, and click on "Find a Location." This fires up the location services of your browser. When you accept, your latitude and longitude are tracked. After a fast, reliable and resource-efficient algorithm, the page offers the location of the restaurant from the Lizard's chain that is closest to you. Simple, right?

Contact Us

Tizona Scientific Solutions LLC

230 Corley Woods Drive
Lexington, SC 29072

voice: (803) 386-1822

Sample Client Base


About Us

Tizona is a scientific consulting company dedicated to solving challenging problems through the development and application of advanced mathematical methods.

Tizona's employees are experts in their technical fields who have made the commitment to solve real-world problems. They excel in approximation theory, image processing, physical modeling, and software development. At Tizona, we believe in combining talent with willingness to work on challenging problems and to extend knowledge to other disciplines. This philosophy allows us to create effective approaches to problem solving and product development that has been highly successful.