~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to examples/c/x16c.c

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: x16c.c,v 1.25 2004/01/19 23:10:25 airwin Exp $
 
1
/* $Id: x16c.c,v 1.28 2005/10/07 17:53:37 airwin Exp $
2
2
 
3
3
        plshade demo, using color fill.
4
4
 
89
89
"test results from ns around 5 and nx, ny around 25.",
90
90
NULL};
91
91
 
92
 
int
 
92
PLINT
93
93
zdefined (PLFLT x, PLFLT y)
94
94
{
95
95
  PLFLT z = sqrt(x * x + y * y);
122
122
/* Parse and process command line arguments */
123
123
 
124
124
    plMergeOpts(options, "x16c options", notes);
125
 
    plParseOpts(&argc, argv, PL_PARSE_FULL);
 
125
    plparseopts(&argc, argv, PL_PARSE_FULL);
126
126
 
127
127
/* Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display */
128
128
 
185
185
        for (j = 0; j < ny; j++) {
186
186
            mypltr((PLFLT) i, (PLFLT) j, &x, &y, NULL);
187
187
 
188
 
            argx = x * PI/2;
189
 
            argy = y * PI/2;
 
188
            argx = x * M_PI/2;
 
189
            argy = y * M_PI/2;
190
190
            distort = 0.4;
191
191
 
192
192
            cgrid1.xg[i] = x + distort * cos(argx);
314
314
    for (i = 0; i < nx; i++) {
315
315
        r = ((PLFLT) i)/ (nx-1);
316
316
        for (j = 0; j < ny; j++) {
317
 
           t = (2.*PI/(ny-1.))*j;
 
317
           t = (2.*M_PI/(ny-1.))*j;
318
318
           cgrid2.xg[i][j] = r*cos(t);
319
319
           cgrid2.yg[i][j] = r*sin(t);
320
 
           z[i][j] = exp(-r*r)*cos(5.*PI*r)*cos(5.*t);
 
320
           z[i][j] = exp(-r*r)*cos(5.*M_PI*r)*cos(5.*t);
321
321
        }
322
322
    }
323
323
 
336
336
 
337
337
/* Now we can draw the perimeter.  (If do before, shade stuff may overlap.) */
338
338
      for (i = 0; i < PERIMETERPTS; i++) {
339
 
               t = (2.*PI/(PERIMETERPTS-1))*(double)i;
 
339
               t = (2.*M_PI/(PERIMETERPTS-1))*(double)i;
340
340
               px[i] = cos(t);
341
341
               py[i] = sin(t);
342
342
      }