home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 344b.lha / plplot_v2.6 / src / setsub.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-27  |  793 b   |  32 lines

  1. /* Sets up the subpage boundaries according to the current subpage  */
  2. /* selected */
  3.  
  4. #include "plplot.h"
  5.  
  6. void setsub()
  7. {
  8.       PLINT ix, iy;
  9.       PLINT nsubx, nsuby, cursub;
  10.       PLFLT spdxmi, spdxma, spdymi, spdyma;
  11.       PLINT sppxmi, sppxma, sppymi, sppyma;
  12.  
  13.       gsub(&nsubx,&nsuby,&cursub);
  14.       ix = (cursub-1)%nsubx;
  15.       iy = nsuby - (cursub-1)/nsubx;
  16.  
  17.       spdxmi = (PLFLT)(ix)/(PLFLT)(nsubx);
  18.       spdxma = (PLFLT)(ix+1)/(PLFLT)(nsubx);
  19.       spdymi = (PLFLT)(iy-1)/(PLFLT)(nsuby);
  20.       spdyma = (PLFLT)(iy)/(PLFLT)(nsuby);
  21.       sspd(spdxmi,spdxma,spdymi,spdyma);
  22.  
  23.       sppxmi = dcpcx(spdxmi);
  24.       sppxma = dcpcx(spdxma);
  25.       sppymi = dcpcy(spdymi);
  26.       sppyma = dcpcy(spdyma);
  27.       sspp(sppxmi,sppxma,sppymi,sppyma);
  28.  
  29.       sclp(sppxmi,sppxma,sppymi,sppyma);
  30.  
  31. }
  32.