X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fgis-util.c;h=f748cd2e280675a7170d143972f1ccbb3c277532;hb=6c3ff0041c881fd3cae9a06a38cd75abc66bb26c;hp=951b45219aff7b5a733e890cf9459320f40c6302;hpb=5350256efff1c97426e0db60e404bfd8a6cb08be;p=grits diff --git a/src/gis-util.c b/src/gis-util.c index 951b452..f748cd2 100644 --- a/src/gis-util.c +++ b/src/gis-util.c @@ -191,9 +191,9 @@ void xyz2ll(gdouble x, gdouble y, gdouble z, */ gdouble ll2m(gdouble lon_dist, gdouble lat) { - gdouble azim = (-lat+90)/180*M_PI; - gdouble rad = sin(azim) * EARTH_R; - gdouble circ = 2 * M_PI * rad; + gdouble incl = lat2incl(lat); + gdouble rad = sin(incl) * EARTH_R; + gdouble circ = 2 * G_PI * rad; return lon_dist/360 * circ; }