home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / util / raytracr.sit / g_bod.c.bin / g_bod.c
Encoding:
C/C++ Source or Header  |  1988-11-13  |  662 b   |  37 lines  |  [TEXT/KAHL]

  1. #include <stdio.h>
  2. #include <math.h>
  3. #include "extern.h"
  4. #include "macros.h"
  5.  
  6.  
  7. g_bod (f)
  8. FILE * f;
  9. {
  10.     int     k,
  11.             x;
  12.     double  big = 0.0,
  13.             little = HUGE;
  14.     char    buf[513];
  15.  
  16.  
  17.     for (ysue = 0;ysue < 300 ; ysue++) {
  18.     if (fgets (buf, 513, f) == NULL)
  19.         break;
  20.         
  21.     xsue = strlen (buf) - 1;
  22.     if (xsue >= 300) xsue = 300 - 1;
  23.     CallStdEvent();
  24.     for (x = 0; x < xsue; x++) {
  25.         k = buf[x];
  26.         suzie[x][ysue] = (double) k;
  27.         if (big < k)
  28.         big = k;
  29.         if (little > k)
  30.         little = k;
  31.     }
  32.     }
  33.     big = big - little;
  34.     for (k = 0; k < ysue; k++)
  35.     for (x = 0; x < xsue; x++)
  36.         suzie[x][k] = (suzie[x][k] - little) / big;
  37. }