User:Tcncv/Geodist

This template is a currently in a proof-of-concept stage. It will calculate the distance (in km) between two geographic points using the Haversine formula. The result is currently an inexact computation that assumes a spherical earth and is accurate to within 0.5%. Further refinement may be possible but would require a large increase in complexity to implement Vincenty's formulae. Options and variations could also be implemented to accept alternate input parameter sets and to emit properly formatted and results at an appropriate precision.

Usage:

All parameters are signed decimal values in degrees.

Examples:
 * 45 degrees lat =
 * 45 degrees long =
 * 45/45 lat/long =
 * Paris to Berlin km (Vincenty 878594.288 m)
 * Los Angeles to Perth km (Vincenty 15023747.718 m)
 * London to Cape Town km (Vincenty 9635442.275 m)

Nominal earth radius used ≈ 6367.4 = (6378.137 + 6356.7523142)/2