Computer Graphics

Graphics Project : Bar Diagram [A Project work in Computer Graphics]

This was a Computer Graphics Project named Bar Diagram required in the coursework. [A Project work in Computer Graphics] #include #include #include #include #include #include /*FUNCTION FOR READING DATA FROM USER*/ void input(float ,float,float,float,float,float); /*FUNCTION FOR DRAWING BAR DIAGRAM*/ void bar1 (float); void bar2 (float); void bar3 (float); void bar4 (float); void bar5 (float); void …

Graphics Project : Bar Diagram [A Project work in Computer Graphics] Read complete article »

Write a program (WAP) to draw a circle using Mid-point Algorithm

Although Bresenham’s algorithm is based upon integral operations only and is much faster than other algorithms, yet there is one drawback of this algorithm. This method is not uniformly applicable to all sorts of conics. For eg, for the ellipse drawing procedure, we need to treat two different regions in the first quadrant differently. This …

Write a program (WAP) to draw a circle using Mid-point Algorithm Read complete article »

To draw a line by using Bresenham's line drawing algorithm

to draw a line by using Bresenham’s line drawing algorithm // modified version checks slope sign and function realization #include #include #include #include #include void func(int, int, int, int); void main() { int gd=DETECT, gm; initgraph(&gd, &gm, “c:\\tc\\bgi”); int x1, y1, x2, y2, dx, dy, p; cout< cin>>x2>>y2; dx= abs(x2-x1); dy= abs(y2-y1); int slope= dy/dx; …

To draw a line by using Bresenham's line drawing algorithm Read complete article »

Scroll to Top