Blob


1 #include <u.h>
2 #include <libc.h>
3 #include "map.h"
5 static struct coord stdpar;
7 static int
8 Xconic(struct place *place, double *x, double *y)
9 {
10 double r;
11 if(fabs(place->nlat.l-stdpar.l) > 80.*RAD)
12 return(-1);
13 r = stdpar.c/stdpar.s - tan(place->nlat.l - stdpar.l);
14 *x = - r*sin(place->wlon.l * stdpar.s);
15 *y = - r*cos(place->wlon.l * stdpar.s);
16 if(r>3) return(0);
17 return(1);
18 }
20 proj
21 conic(double par)
22 {
23 if(fabs(par) <.1)
24 return(Xcylindrical);
25 deg2rad(par, &stdpar);
26 return(Xconic);
27 }