1 #include "map.h" 2 3 static int 4 Xlagrange(struct place *place, double *x, double *y) 5 { 6 double z1,z2; 7 double w1,w2,t1,t2; 8 struct place p; 9 copyplace(place,&p); 10 if(place->nlat.l<0) { 11 p.nlat.l = -p.nlat.l; 12 p.nlat.s = -p.nlat.s; 13 } 14 Xstereographic(&p,&z1,&z2); 15 csqrt(-z2/2,z1/2,&w1,&w2); 16 cdiv(w1-1,w2,w1+1,w2,&t1,&t2); 17 *y = -t1; 18 *x = t2; 19 if(place->nlat.l<0) 20 *y = -*y; 21 return(1); 22 } 23 24 proj 25 lagrange(void) 26 { 27 return(Xlagrange); 28 } 29