Annotation of researchv8dc/cmd/map/libmap/mercator.c, revision 1.1.1.1

1.1       root        1: #include "map.h"
                      2: #include <math.h>
                      3: 
                      4: static
                      5: Xmercator(place,x,y)
                      6: struct place *place;
                      7: float *x, *y;
                      8: {
                      9:        if(fabs(place->nlat.l) > 80.*RAD)
                     10:                return(-1);
                     11:        *x = -place->wlon.l;
                     12:        *y = 0.5*log((1+place->nlat.s)/(1-place->nlat.s));
                     13:        return(1);
                     14: }
                     15: 
                     16: int (*mercator())()
                     17: {
                     18:        return(Xmercator);
                     19: }
                     20: static float ecc = ECC;
                     21: 
                     22: static
                     23: Xspmercator(place,x,y)
                     24: struct place *place;
                     25: float *x, *y;
                     26: {
                     27:        if(Xmercator(place,x,y) < 0)
                     28:                return(-1);
                     29:        *y += 0.5*ecc*log((1-ecc*place->nlat.s)/(1+ecc*place->nlat.s));
                     30:        return(1);
                     31: }
                     32: 
                     33: int (*sp_mercator())()
                     34: {
                     35:        return(Xspmercator);
                     36: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.