home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / splot122.zip / DEMO / GSAVE.SPT < prev    next >
Text File  |  1994-07-18  |  942b  |  51 lines

  1.  
  2. #include <splot.h>
  3.  
  4. int i;
  5. double x,y,d,l;
  6.  
  7. main()
  8.    {
  9.    /* draw 3d stack of pages */
  10.    x = 5;
  11.    y = 15;
  12.    l = 4;
  13.    for (i = 0;i <= 10;i++;)
  14.       {
  15.       d = i * 0.2;
  16.       box(x - d ,y - d, x - d + l, y - d + l);
  17.       gsave();
  18.       set(LINECOLOUR,WHITE);
  19.       fill();
  20.       grestore();
  21.       stroke();
  22.       }
  23.    /* draw sample */
  24.    arc(5.02,14.96,1.2,0,360);
  25.    fill();
  26.    white_box(3.95,13.51,6.134,13.904);
  27.    white_box(3.862,13.689,3.752,15.443);
  28.    /* draw axes */
  29.    moveto(3.00,10.19);
  30.    rarrowto(0.0,2);
  31.    moveto(3.00,10.19);
  32.    rarrowto(2,0);
  33.    moveto(3.00,10.19);
  34.    rarrowto(1.6,1.6);
  35.    stroke();
  36.    /* add labels */
  37.    text(5.20,9.71,"X");
  38.    text(2.31,11.82,"Y");
  39.    text(5.01,11.64,"!l");
  40.    }
  41.  
  42. int white_box(double x1,double y1,double x2,double y2)
  43.    { 
  44.    gsave();
  45.    newpath();
  46.    box(x1,y1,x2,y2);
  47.    set(LINECOLOUR,WHITE);
  48.    fill();
  49.    grestore();
  50.    }
  51.