home *** CD-ROM | disk | FTP | other *** search
- #include "gfunc.h"
- #include <stdio.h>
- #include <math.h>
-
- void main()
-
- {
- int err0,err1,i;
- double x[5],y[5];
-
- /*********
- * Figuren
- *********/
- err0 = initialize(0,0); /* Initialisierung */
- if (err0 == 0)
- {
- frame(300.0,210.0); /* Rahmen definieren */
- picture(300.0,210.0,0.0,0.0); /* Bildbereich definieren */
- err1 = mkwind(); /* Fenster ÷ffnen */
- if (err1 != 0) exit(-1);
- x[0] = 10.0;
- y[0] = 10.0;
- x[1] = 80.0;
- y[1] = y[0];
- x[2] = x[1];
- y[2] = x[1];
- x[3] = x[0];
- y[3] = x[1];
- x[4] = x[0];
- y[4] = y[0];
- setpat(3,NULL,0);
- polyfill(5,x,y,6);
- x[0] = x[1];
- y[0] = y[1];
- x[1] = x[0]+200.0*sin(45.0);
- y[1] = y[0]+200.0*cos(45.0);
- x[2] = x[1];
- y[2] = y[1]+70.0;
- x[3] = 80.0;
- y[3] = 80.0;
- x[4] = x[0];
- y[4] = y[0];
- setpat(2,NULL,0);
- polyfill(5,x,y,2);
- x[0] = 80.0;
- y[0] = 80.0;
- x[1] = x[2];
- y[1] = y[2];
- x[2] = x[1]-70.0;
- y[2] = y[1];
- x[3] = 10.0;
- y[3] = 80.0;
- x[4] = x[0];
- y[4] = y[0];
- setpat(1,NULL,0);
- polyfill(5,x,y,10);
- setpen(1);
- setfont("ruby.font",15);
- htext(150.0,195.0,"MB","Beispiel 3: Einfache Figuren");
- finish();
- }
- else
- {
- printf("Fehler bei Initialisierung. (Fehler Nr. %d)\n",err0);
- finish();
- }
- }
-