Maps plotting

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 }

Copyright 2006 Roman Putanowicz

Email: putanowr at twins.pk.edu.pl

Last Modified: Thu, 13 Jul 2006 15:38:52 CEST

Made with PubTal 3.1.3