plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

aitoff.c (397B)


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