![]() ![]() DDA Algorithms uses multiplication & division its operationĢ.Bresenham's Line Algorithm uses only subtraction and addition its operationģ. Bresenham's Line Algorithm use fixed point, i.e., Integer ArithmeticĢ. DDA Algorithm use floating point, i.e., Real Arithmetic.ġ. Output: Differentiate between DDA Algorithm and Bresenham's Line Algorithm: DDA Algorithmġ. ![]() Printf("Enter co-ordinates of second point: ") Printf("Enter co-ordinates of first point: ") Initgraph(&gdriver, &gmode, "c: urboc3gi") Int gdriver=DETECT, gmode, error, x0, y0, x1, y1 Void drawline(int x0, int y0, int x1, int y1) Program to implement Bresenham's Line Drawing Algorithm: Step10: Draw a point of latest (x, y) coordinatesĮxample: Starting and Ending position of the line are (1, 1) and (8, 5). Step8: Calculate co-ordinates of the next pixel Step6: Generate point at (x,y)coordinates. Now consider the difference between these 2 distance values The distance from T to the actual line in y direction The distance from S to the actual line in y direction The actual y coordinates of the line at x = x i+1is To chooses the next one between the bottom pixel S and top pixel T. The line is best approximated by those pixels that fall the least distance from the path between P 1',P 2'.
0 Comments
Leave a Reply. |