laue.c 326 B

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