xref: /plan9/sys/src/cmd/map/libmap/aitoff.c (revision 219b2ee8daee37f4aad58d63f21287faa8e4ffdc)
1 #include "map.h"
2 
3 #define Xaitwist Xaitpole.nlat
4 static struct place Xaitpole;
5 
6 static int
7 Xaitoff(struct place *place, double *x, double *y)
8 {
9 	struct place p;
10 	copyplace(place,&p);
11 	p.wlon.l /= 2.;
12 	sincos(&p.wlon);
13 	norm(&p,&Xaitpole,&Xaitwist);
14 	Xazequalarea(&p,x,y);
15 	*x *= 2.;
16 	return(1);
17 }
18 
19 proj
20 aitoff(void)
21 {
22 	latlon(0.,0.,&Xaitpole);
23 	return(Xaitoff);
24 }
25