/* Problem Statement:Write C++ program to draw the following pattern. Use DDA line and Bresenham's circle drawing algorithm. Apply the concept of encapsulation. Code from Computer Graphics (SPPU - Second Year - Computer Engineering - Content) repository on KSKA Git: https://git.kska.io/sppu-se-comp-codes/CG */ // BEGINNING OF CODE #include #include #include using namespace std; class algo { public: void dda_line(float x1, float y1, float x2, float y2); void bresneham_cir(int r); }; void algo::dda_line(float x1, float y1, float x2, float y2) { float x,y,dx,dy,step; int i; //step 2 dx=abs(x2-x1); dy=abs(y2-y1); cout<<"dy="<=dy) step=dx; else step=dy; cout<<"\n"<>r; a1.bresneham_cir((int)r); ang=3.24/180; float c=r*cos(30*ang); float s=r*sin(30*ang); a1.dda_line(0,r,0-c,0-s); a1.dda_line(0-c,0-s,0+c,0-s); a1.dda_line(0+c,0-s,0,r); r1=s; a1.bresneham_cir((int)r1); getch(); closegraph(); return 0; } // END OF CODE