We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distance calculations for each arobject is incorrect. For one thing, the formulae:
double latitudeDistance = max(lat, currentLoc.latitude) - min(lat, currentLoc.latitude); double longitudeDistance = max(lon, currentLoc.longitude) - min(lon, currentLoc.longitude); return (sqrt(pow(latitudeDistance*lat_over_lon,2) + pow(longitudeDistance, 2))) * meterToMiles;
Is location dependent and invalid.
The text was updated successfully, but these errors were encountered:
This is an improvement:
double latitudeDistance = lat - currentLoc.latitude; double longitudeDistance = lon - currentLoc.longitude; return (sqrt(pow(latitudeDistance,2) + pow(longitudeDistance*1.3, 2))) * 5;
The "1.3" is how much a degree of lon is 1.3 times less than a lat where I am (here in Chicago)
I might have to implement a lat/lon difference calculator depending on the user's location...
Sorry, something went wrong.
Actually CLLocation has a "distanceFromLocation" callback.. will look into that
http://stackoverflow.com/questions/5198996/cllocation-distancefromlocation
Fixed:
CLLocationCoordinate2D object_loc_coord = CLLocationCoordinate2DMake(lat, lon); CLLocation *object_location = [[CLLocation alloc] initWithLatitude:object_loc_coord.latitude longitude:object_loc_coord.longitude]; CLLocation *user_location = [[CLLocation alloc] initWithLatitude:user_loc_coord.latitude longitude:user_loc_coord.longitude]; return [object_location distanceFromLocation:user_location];
glesage
No branches or pull requests
Distance calculations for each arobject is incorrect.
For one thing, the formulae:
Is location dependent and invalid.
The text was updated successfully, but these errors were encountered: