Skip to content

Instantly share code, notes, and snippets.

@stefanluptak
Created January 28, 2011 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanluptak/800041 to your computer and use it in GitHub Desktop.
Save stefanluptak/800041 to your computer and use it in GitHub Desktop.
Meter to degrees based on Geographical Latitude
// Calculates the degree value of 1 meter at given geographical latitude
#define EARTH_RADIUS 6371000
- (double)meterToDegreeAtLatitude:(double)aLatitudeInDegrees {
double aLatitudeInRadians = aLatitudeInDegrees * (M_PI / 180);
return (1 / (cos(aLatitudeInRadians) * EARTH_RADIUS)) * (180 / M_PI);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment