home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <plot/plotlib.h>
-
- DATA sin();
- DATA cos();
-
- main()
- {
- int erfolg,sinid,cosid;
- char a;
-
- erfolg = open_plot();
- if (!erfolg)
- {
- dis_ploterror();
- exit(5);
- }
-
- sinid = get_data(sin,-4.0,4.0,300);
- if (!sinid)
- dis_ploterror();
- cosid = get_data(cos,-4.0,4.0,300);
- if (!cosid)
- dis_ploterror();
-
- if (sinid && cosid)
- {
- erfolg = set_axisname(XAXIS,"Kreisfrequenz");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_axisname(YAXIS,"Amplitude");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_titel("Beispiel 4");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_curvename(sinid,"y = sin(x)");
- if (!erfolg)
- dis_ploterror();
- erfolg = set_curvename(cosid,"y = cos(x)");
- if (!erfolg)
- dis_ploterror();
- erfolg = display(SCREENOUT,GRAPHNOTSET);
- if (!erfolg)
- dis_ploterror();
- else
- {
- a = getchar();
- erfolg = display(SCREENCLOSE,NULL);
- if (!erfolg)
- dis_ploterror();
- }
- }
- erfolg = close_plot();
- if (!erfolg)
- dis_ploterror();
- exit(0);
- }
-