diff options
| author | rsc <devnull@localhost> | 2004-04-21 22:19:33 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-04-21 22:19:33 +0000 |
| commit | 28994509cc11ac6a5443054dfae1fedfb69039bc (patch) | |
| tree | 9d5adcd11af2708db0ecc246e008c308ca0f97d4 /src/cmd/map/libmap/conic.c | |
| parent | a01e58366c54804f15f84d6e21d13f2e4080977a (diff) | |
| download | plan9port-28994509cc11ac6a5443054dfae1fedfb69039bc.tar.gz plan9port-28994509cc11ac6a5443054dfae1fedfb69039bc.zip | |
Why not?
Diffstat (limited to 'src/cmd/map/libmap/conic.c')
| -rw-r--r-- | src/cmd/map/libmap/conic.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/cmd/map/libmap/conic.c b/src/cmd/map/libmap/conic.c new file mode 100644 index 00000000..ba4430c6 --- /dev/null +++ b/src/cmd/map/libmap/conic.c @@ -0,0 +1,27 @@ +#include <u.h> +#include <libc.h> +#include "map.h" + +static struct coord stdpar; + +static int +Xconic(struct place *place, double *x, double *y) +{ + double r; + if(fabs(place->nlat.l-stdpar.l) > 80.*RAD) + return(-1); + r = stdpar.c/stdpar.s - tan(place->nlat.l - stdpar.l); + *x = - r*sin(place->wlon.l * stdpar.s); + *y = - r*cos(place->wlon.l * stdpar.s); + if(r>3) return(0); + return(1); +} + +proj +conic(double par) +{ + if(fabs(par) <.1) + return(Xcylindrical); + deg2rad(par, &stdpar); + return(Xconic); +} |
