5 int Xstereographic(struct place *place, double *x, double *y);
7 static struct place eastpole;
8 static struct place westpole;
9 static double eastx, easty;
10 static double westx, westy;
14 /* conformal map w = ((1+z)^A - (1-z)^A)/((1+z)^A + (1-z)^A),
15 where A<1, maps unit circle onto a convex lune with x= +-1
16 mapping to vertices of angle A*PI at w = +-1 */
18 /* there are cuts from E and W poles to S pole,
19 in absence of a cut routine, error is returned for
20 points outside a polar cap through E and W poles */
22 static int Xlune(struct place *place, double *x, double *y)
24 double stereox, stereoy;
25 double z1x, z1y, z2x, z2y;
26 double w1x, w1y, w2x, w2y;
27 double numx, numy, denx, deny;
28 if(place->nlat.l < eastpole.nlat.l-FUZZ)
30 Xstereographic(place, &stereox, &stereoy);
37 cpow(z1x,z1y,&w1x,&w1y,pwr);
38 cpow(z2x,z2y,&w2x,&w2y,pwr);
43 cdiv(numx, numy, denx, deny, x, y);
48 lune(double lat, double theta)
50 deg2rad(lat, &eastpole.nlat);
51 deg2rad(-90.,&eastpole.wlon);
52 deg2rad(lat, &westpole.nlat);
53 deg2rad(90. ,&westpole.wlon);
54 Xstereographic(&eastpole, &eastx, &easty);
55 Xstereographic(&westpole, &westx, &westy);
56 if(fabs(easty)>FUZZ || fabs(westy)>FUZZ ||
57 fabs(eastx+westx)>FUZZ)