diff options
Diffstat (limited to 'src/makepic.c')
-rw-r--r-- | src/makepic.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/makepic.c b/src/makepic.c deleted file mode 100644 index 5c54cbd..0000000 --- a/src/makepic.c +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | //#define MUENCHEN | ||
2 | //#define MAGDEBURG | ||
3 | #define BREMEN | ||
4 | |||
5 | #ifdef MUENCHEN | ||
6 | /* Muenchen */ | ||
7 | #define GEOXMIN 5295821.0 | ||
8 | #define GEOXMAX 5334858.0 | ||
9 | #define GEOYMIN 3233408.0 | ||
10 | #define GEOYMAX 3270042.0 | ||
11 | #endif | ||
12 | |||
13 | #ifdef MAGDEBURG | ||
14 | /* Magdeburg */ | ||
15 | #define GEOXMIN 5305003.0 | ||
16 | #define GEOXMAX 5316797.0 | ||
17 | #define GEOYMIN 3682236.0 | ||
18 | #define GEOYMAX 3704266.0 | ||
19 | #endif | ||
20 | |||
21 | #ifdef BREMEN | ||
22 | /* Bremen */ | ||
23 | #define GEOXMIN 5098053.0 | ||
24 | #define GEOXMAX 5134674.0 | ||
25 | #define GEOYMIN 3784147.0 | ||
26 | #define GEOYMAX 3819770.0 | ||
27 | #endif | ||
28 | |||
29 | #define GEOXSIZE (GEOXMAX - GEOXMIN) | ||
30 | #define GEOYSIZE (GEOYMAX - GEOYMIN) | ||
31 | |||
32 | #define PICXSIZE (2*768.0) | ||
33 | #define PICYSIZE (2*768.0) | ||
34 | |||
35 | #include <stdio.h> | ||
36 | #include <math.h> | ||
37 | |||
38 | int main( int args, char **argv) | ||
39 | { | ||
40 | unsigned long pic[ (long)(PICXSIZE * (PICYSIZE+10)) ]; | ||
41 | char line[1024]; | ||
42 | int x, y; | ||
43 | |||
44 | double xscale = (PICXSIZE / GEOXSIZE), | ||
45 | yscale = (PICYSIZE / GEOYSIZE); | ||
46 | double scale = xscale > yscale ? yscale : xscale; | ||
47 | |||
48 | memset( pic, 0, sizeof( pic)); | ||
49 | |||
50 | while( scanf( "%ld\t%ld\n", &x, &y) == 2) | ||
51 | { | ||
52 | double myx = x - GEOXMIN, myy = GEOYSIZE - (y - GEOYMIN); | ||
53 | if( (x < GEOXMAX) && (x >= GEOXMIN) && (y < GEOYMAX) && (y >= GEOYMIN)) | ||
54 | pic[ (long)(((long)(myx * scale)) + ((long)( myy * scale )) * (long)PICXSIZE) ]++; | ||
55 | } | ||
56 | |||
57 | printf( "P5\n%ld %ld\n255\n", (long)PICXSIZE, (long)PICYSIZE ); | ||
58 | for( x = 0; x < PICXSIZE * PICYSIZE; x++) | ||
59 | putchar( sqrt( 32*256*256 * pic[ x ])); | ||
60 | |||
61 | return 0; | ||
62 | } | ||