home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_06 / v7n6047a.txt < prev    next >
Text File  |  1989-07-25  |  640b  |  38 lines

  1. #include <stdio.h>
  2. #include "plot.h"
  3. #include "math.h"
  4.  
  5. main()
  6. {
  7. int ws,k,i;
  8. Glimit w;
  9. Gilimit v;
  10. Gpoint p[4];
  11. double theta,phi,g();
  12. char *st;
  13. st = "ega";
  14. ws = 0;
  15. theta = 0.5; phi = 0.3;
  16. openws (ws,st);
  17. w.xmin = -15.0; w.ymin = -5.0;
  18. w.xmax = 15.0; w.ymax = 5.0;
  19. v.xmin = 0; v.ymin = 0;
  20. v.xmax = 600; v.ymax = 300;
  21. setwindow (ws,0,&w);
  22. setviewport (ws,0,&v);
  23. selntran (ws,0);
  24. setlinecolour (ws,15);
  25. plotx (ws,g,30,theta,phi,-10.0,10.0,-10.0,10.0);
  26. pause();
  27. closews(ws);
  28. }
  29.  
  30. double g(x,y)
  31. double x,y;
  32. {
  33. double a,b;
  34. a = (x != 0.0) ? (sin(x)/x):1.0;
  35. b = (y != 0.0) ? (sin(y)/y):1.0;
  36. return (4.0*a*b);
  37. }
  38.