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 More »

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 More »