home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / gle / util / surf / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-29  |  419 b   |  24 lines

  1. #include <ctype.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <math.h>
  6. #include <stdarg.h>
  7. main()
  8. {
  9.     double  z,xx,yy;
  10.     int x,y;
  11.     int nx=300, ny=300;
  12.  
  13.     printf("! nx %d ny %d \n",nx,ny);
  14.     for (x=0; x<nx; x++) {
  15.         for (y=0;y<ny; y++) {
  16.             xx = x/6.0; yy = y/6.0;
  17.             z = 3.0/2.0*(cos(3./5.*(yy-1))+5./4.) / (1.+( pow(((xx-4.)/3.),2)  ));
  18.             printf("%g ",z);
  19.         }
  20.         printf("\n");
  21.     }
  22.     printf("\n");
  23. }
  24.