|
|
1.1 root 1: #include <math.h>
2:
3: double
4: fn(x, y, t, wl)
5: float t, wl;
6: {
7: return(sin(t + 2*PI*sqrt(x*x + (float)y*y)/wl));
8: }
9:
10: main(argc, argv)
11: char **argv;
12: {
13: register i, j, n, t, k;
14: register float tim, delta;
15:
16: if((n = atoi(argv[1])) <= 4)
17: n = 16;
18: if((t = atoi(argv[2])) <= 1)
19: t = 4;
20: delta = 2*PI/t;
21: for(k = 0, tim = 0; k < t; k++)
22: {
23: printf("%d %.1f\n", n*n, tim);
24: for(i = 0; i < n; i++)
25: for(j = 0; j < n; j++)
26: printf("%d %d %g\n", j, i, fn(j-n/2, i-n/2, tim, n/3.0));
27: tim += delta;
28: }
29: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.