#include #include #include "mygraph.h" #include "point.h" #include "Xroutines.h" # define M_PI 3.14159265358979323846 dc_draw_line ( line aline, environment * env) { DrawLine(aline.e1.x, aline.e1.y,aline.e2.x, aline.e2.y, env); } draw_circle(environment * env,int xc,int yc,int r) { int x, y; int p; y = r; p = 3-2*r; for(x=0;x<=y;x++) { SetPixel(env,xc+x,yc+y); SetPixel(env,xc-x,yc+y); SetPixel(env,xc+x,yc-y); SetPixel(env,xc-x,yc-y); SetPixel(env,xc+y,yc+x); SetPixel(env,xc-y,yc+x); SetPixel(env,xc+y,yc-x); SetPixel(env,xc-y,yc-x); if (p < 0) { p += 4*x+6; } else { p += 4*(x-y)+10; y -= 1; } } }