Image obtained by using color PostScript driver (psc) and then converted to animated gif using ImageMagick convert tool.

1 2 #pragma _ipath "./" 3 #include "plcdemos.h" 4 5 6 void 7 mapform19(PLINT n, PLFLT *x, PLFLT *y) 8 { 9 int i; 10 double xp, yp, radius; 11 for (i = 0; i < n; i++) { 12 radius = 90.0 - y[i]; 13 xp = radius * cos(x[i] * PI / 180.0); 14 yp = radius * sin(x[i] * PI / 180.0); 15 x[i] = xp; 16 y[i] = yp; 17 } 18 } 19 20 21 int 22 main(int argc, char **argv) 23 { 24 PLFLT minx, maxx, miny, maxy; 25 int c; 26 27 28 (void) plParseOpts(&argc, argv, PL_PARSE_FULL); 29 30 31 miny = -70; 32 maxy = 80; 33 34 plinit(); 35 36 37 minx = 190; 38 maxx = 190+360; 39 40 plcol0(1); 41 plenv(minx, maxx, miny, maxy, 1, -1); 42 plmap(NULL, "usaglobe", minx, maxx, miny, maxy); 43 44 45 minx = 190; 46 maxx = 340; 47 48 plcol0(1); 49 plenv(minx, maxx, miny, maxy, 1, -1); 50 plmap(NULL, "usaglobe", minx, maxx, miny, maxy); 51 52 53 minx = 0; 54 maxx = 360; 55 56 plenv(-75., 75., -75., 75., 1, -1); 57 plmap(mapform19,"globe", minx, maxx, miny, maxy); 58 59 pllsty(2); 60 plmeridians(mapform19,10.0, 10.0, 0.0, 360.0, -10.0, 80.0); 61 plend(); 62 exit(0); 63 }
Code description
- 1
- $Id: x19c.c,v 1.10 2002/12/17 20:48:14 airwin Exp $ Illustrates backdrop plotting of world, US maps. Contributed by Wesley Ebisuzaki.
- 5
- --------------------------------------------------------------------------*\ * mapform19 * * Defines specific coordinate transformation for example 19. * Not to be confused with mapform in src/plmap.c. * x[], y[] are the coordinates to be plotted. \*--------------------------------------------------------------------------
- 20
- --------------------------------------------------------------------------*\ * main * * Shows two views of the world map. \*--------------------------------------------------------------------------
- 27
- Parse and process command line arguments
- 30
- Longitude (x) and latitude (y)
- 36
- Cartesian plots
- 36
- Most of world
- 44
- The Americas
- 52
- Polar, Northern hemisphere