Due to the curvature of the earth, the distance between two points is not a straight line. These routines calculate the distance over the earth as a sphere.

Procedure Name | Type | Description |

(Declarations) | Declarations | Declarations and private variables for the modDistance module. |

DistanceCosines | Procedure | Calculate the arc distance between two latitude/longitude points based on the spherical law of cosines. In spherical trigonometry, the law of cosines (also called the cosine rule for sides) is a theorem relating the sides and angles of spherical triangles, analogous to the ordinary law of cosines from plane trigonometry. For more information, visit Spherical Law of Cosines. |

DistanceHaversine | Procedure | Calculate the distance between two latitude/longitude points based on the Haversine formula. The Haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the Law of Haversines, relating the sides and angles of spherical triangles. For more information, visit Haversine Formula. |

ArcCosine | Procedure | Get the arc cosine of the supplied radians. |

DegreesToRadians | Procedure | Convert degrees to radians (180 degrees equals PI radians). |

The source code in Total Visual Sourcebook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Total Visual SourceBook is written for the needs of a developer using a source code library covering the many challenges you face. Countless developers over the years have told us they learned some or much of their development skills and tricks from our code. You can too!

is Shipping!

Supports Access/Office 2016, 2013, 2010 and 2007, and Visual Basic 6.0!

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP