Bresenham's Circle Drawing C++ Program
#include<conio.h>
#include<Graphics.h>
#include<stdio.h>
void main() {
int gd = DETECT, gm;
initgraph (&gd, &gm, "C:\\TC\\BGI");
int xc, yc, x, y, r, D;
printf ("Enter Radius of Circle: ");
scanf ("%d", &r);
printf ("Enter coordinates of centre of Circle: ");
scanf ("%d%d", &xc, &yc);
x=0; y=r;
D=3-(2*r); //Initial Decision parameter
while (x<=y) {
putpixel (y+xc, x+yc, 15 ); //……octet-1
putpixel (x+xc, y+yc, 15 ); //……octet-2
putpixel (-x+xc, y+yc, 15 ); //……octet-3
putpixel (-y+xc, x+yc, 15 ); //……octet-4
putpixel (-y+xc, -x+yc, 15 ); //……octet-5
putpixel (-x+xc, -y+yc, 15 ); //……octet-6
putpixel (x+xc, -y+yc, 15 ); //……octet-7
putpixel (y+xc, -x+yc, 15 ); //……octet-8
if (D<0) {
D=D+4*x+6; //Next Decision Parameter
x++;
}
else {
D=D+4*(x-y)+10; //Next Decision Parameter
x++;
y--;
}
}
getch ();
closegraph ();
}
More>>
Bresenhams circle drawing derivation
Bresenhams Line drawing program in C
Mid point Circle drawing program in C
Mid Point Ellipse drawing program in C
More>>
Bresenhams circle drawing derivation
Bresenhams Line drawing program in C
Mid point Circle drawing program in C
Mid Point Ellipse drawing program in C
ReplyDeleteonline quran
online quran
AguicuQdas-a Gary High https://wakelet.com/wake/gphvOHuXRXvLKlfRUJY4p
ReplyDeletecarsingwhisfi
apcerlise_1991 Mike Anderson CCleaner pro
ReplyDeleteMicrosoft Visio Professional
Slack
fectpaddrahi