Bresenham circle drawing algorithm

Apr 14th, 2015
Studypool Tutor
Price: $5 USD

Tutor description

A graphics program for drawing a circle using Bresenham's circle drawing algorithm. It draws a circle with the specified radius at the specified coordinates

Word Count: 126
Showing Page: 1/2
#include #include #include #include int main(void){int gd = DETECT, gm;int x, xc, y, yc, r, p;initgraph(&gd, &gm, "C:\\turboc3\\bgi");printf("Enter xc:\n");scanf("%d",&xc);printf("enter yc:\n");scanf("%d",&yc);printf("Enter r:\n");scanf("%d",&r);x = 0;y = r;putpixel(xc,yc,WHITE);p = 3-(2*r);while(x<=y){if(p<0){x = x+1;p = p+(4*x)+6;}else{x = x+1;y = y-1;p = p+(4*x)-(4*y)+10;}putpixel(xc+x,yc+y,WHITE); //4putpixel(xc+x,yc-y,WHITE);//1putpixel(xc-x,yc+y,WHITE);//5putpixe

Review from student

Studypool Student
" Thanks, good work "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1822 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors