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

« back to all changes in this revision

Viewing changes to examples/c/x13c.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: x13c.c,v 1.15 2002/12/03 08:39:24 airwin Exp $
 
1
/* $Id: x13c.c,v 1.17 2005/10/07 17:53:37 airwin Exp $
2
2
 
3
3
        Pie chart demo.
4
4
*/
35
35
 
36
36
/* Parse and process command line arguments */
37
37
 
38
 
    (void) plParseOpts(&argc, argv, PL_PARSE_FULL);
 
38
    (void) plparseopts(&argc, argv, PL_PARSE_FULL);
39
39
 
40
40
/* Initialize plplot */
41
41
 
43
43
 
44
44
    plenv(0., 10., 0., 10., 1, -2);
45
45
    plcol0(2);
46
 
    /* n.b. all theta quantities scaled by 2*pi/500 to be integers to avoid
 
46
    /* n.b. all theta quantities scaled by 2*M_PI/500 to be integers to avoid
47
47
     * floating point logic problems. */
48
48
    theta0 = 0;
49
49
    dthet = 1;
51
51
        j = 0;
52
52
        x[j] = 5.;
53
53
        y[j++] = 5.;
54
 
        /* n.b. the theta quantities multiplied by 2*pi/500 afterward so
 
54
        /* n.b. the theta quantities multiplied by 2*M_PI/500 afterward so
55
55
         * in fact per is interpreted as a percentage. */
56
56
        theta1 = theta0 + 5 * per[i];
57
57
        if (i == 4)
58
58
            theta1 = 500;
59
59
        for (theta = theta0; theta <= theta1; theta += dthet) {
60
 
            x[j] = 5 + 3 * cos((2.*PI/500.)*theta);
61
 
            y[j++] = 5 + 3 * sin((2.*PI/500.)*theta);
 
60
            x[j] = 5 + 3 * cos((2.*M_PI/500.)*theta);
 
61
            y[j++] = 5 + 3 * sin((2.*M_PI/500.)*theta);
62
62
        }
63
63
        plcol0(i + 1);
64
64
        plpsty((i + 3) % 8 + 1);
65
65
        plfill(j, x, y);
66
66
        plcol0(1);
67
67
        plline(j, x, y);
68
 
        just = (2.*PI/500.)*(theta0 + theta1)/2.;
 
68
        just = (2.*M_PI/500.)*(theta0 + theta1)/2.;
69
69
        dx = .25 * cos(just);
70
70
        dy = .25 * sin(just);
71
71
        if ((theta0 + theta1)  < 250 || (theta0 + theta1) > 750)