Annotation of researchv10no/cmd/map/libmap/simpleconic.c, revision 1.1.1.1

1.1       root        1: #include "map.h"
                      2: 
                      3: static double r0, a;
                      4: 
                      5: static int
                      6: Xsimpleconic(struct place *place, double *x, double *y)
                      7: {
                      8:        double r = r0 - place->nlat.l;
                      9:        double t = a*place->wlon.l;
                     10:        *x = -r*sin(t);
                     11:        *y = -r*cos(t);
                     12:        return 1;
                     13: }
                     14: 
                     15: proj
                     16: simpleconic(double par0, double par1)
                     17: {
                     18:        struct coord lat0;
                     19:        struct coord lat1;
                     20:        deg2rad(par0,&lat0);
                     21:        deg2rad(par1,&lat1);
                     22:        if(fabs(lat0.l+lat1.l)<.01)
                     23:                return rectangular(par0);
                     24:        if(fabs(lat0.l-lat1.l)<.01) {
                     25:                a = lat0.s/lat0.l;
                     26:                r0 = lat0.c/lat0.s + lat0.l;
                     27:        } else {
                     28:                a = (lat1.c-lat0.c)/(lat0.l-lat1.l);
                     29:                r0 = ((lat0.c+lat1.c)/a + lat1.l + lat0.l)/2;
                     30:        }
                     31:        return Xsimpleconic;
                     32: }

unix.superglobalmegacorp.com

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