xref: /plan9-contrib/sys/src/cmd/map/libmap/laue.c (revision 59cc4ca53493a3c6d2349fe2b7f7c40f7dce7294)
1 #include <u.h>
2 #include <libc.h>
3 #include "map.h"
4 
5 
6 static int
Xlaue(struct place * place,double * x,double * y)7 Xlaue(struct place *place, double *x, double *y)
8 {
9 	double r;
10 	if(place->nlat.l<PI/4+FUZZ)
11 		return(-1);
12 	r = tan(PI-2*place->nlat.l);
13 	if(r>3)
14 		return(-1);
15 	*x = - r * place->wlon.s;
16 	*y = - r * place->wlon.c;
17 	return(1);
18 }
19 
20 proj
laue(void)21 laue(void)
22 {
23 	return(Xlaue);
24 }
25