URI:
       tgall.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tgall.c (512B)
       ---
            1 #include <u.h>
            2 #include <libc.h>
            3 #include "map.h"
            4 
            5 static double scale;
            6 
            7 static int
            8 Xgall(struct place *place, double *x, double *y)
            9 {
           10         /* two ways to compute tan(place->nlat.l/2) */
           11         if(fabs(place->nlat.s)<.1)
           12                 *y = sin(place->nlat.l/2)/cos(place->nlat.l/2);
           13         else
           14                 *y = (1-place->nlat.c)/place->nlat.s;
           15         *x = -scale*place->wlon.l;
           16         return 1;
           17 }
           18 
           19 proj
           20 gall(double par)
           21 {
           22         double coshalf;
           23         if(fabs(par)>80)
           24                 return 0;
           25         par *= RAD;
           26         coshalf = cos(par/2);
           27         scale = cos(par)/(2*coshalf*coshalf);
           28         return Xgall;
           29 }