On 12 June, 2015 - Anton Lundin wrote:
>
> -/* this is in globe.cpp, so including the .h file is a pain */
> -extern double getDistance(int lat1, int lon1, int lat2, int lon2);
> +// We could be propper and use the Haversine formula here, but hey, the
> world is flat dude.
> +static unsigned int get_distance(degrees_t lat1, degrees_t lon1, degrees_t
> lat2, degrees_t lon2)
> +{
> + // Earth radious is about 111.5 km where i live
Sorry, One _degree_ in latitude is about 111.5 km where i live, and
thats the basis for the convertion that 10 udeg is about a meter.
> + return sqrt(lat1.udeg*lat2.udeg + lon1.udeg*lon2.udeg) / 10;
> +}
//Anton
--
Anton Lundin +46702-161604
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface