Question is also related to programming, but maybe I can solve it here. I am using distance calculation using Haversine method(probably it's not important, but I will post the function):
double GeoDistance(GeoCoordinate* p1, GeoCoordinate* p2)
{
const float two=2.0;
double lat1 = p1->lat * factor;
double lon1 = p1->lon * factor;
double lat2 = p2->lat * factor;
double lon2 = p2->lon * factor;
return RADIUS_METER * two * asin(sqrt(square(sin((lat1-lat2)/two)) + cos(lat1)*cos(lat2)*square(sin((lon2-lon1)/two))));
}
This gives me suitable precision. Since I am using this code in tiny microcontroller for number of geo points, I need to optimize this function with some other, which will work faster but precision can suffer. To give an idea on how much precision can suffer I will tell that the approximate distance I am calculating is about 200-400m and it can easily be +- 100m.