[School_ĐHMT] Midpoint algorithm to draw the line
Content
Construction algorithm
Read more
1. General Principles of drawing straight lines
2. DDA algorithm to draw the line
3. Algorithm Breshenham draw straight lines
Construction algorithm
Give 2 endpoints M1(x1, y1), and M2(x2, y2). Equation line through M1, M2 form
At step k 1 we performed x is increased by one unit and seek medical calculated according to the integer x. Call S, P respectively the points with coordinates the midpoint of SP (Point Midpoint), Q is looking. Point the value depends on the position of the point Q than point M. If Q is less than M we take the point S , take the opposite point P .
Set . I have:
Point of M1M2 M <=> F(M) = 0.
M points above the M1M2 <=> F(M) < 0.
Point M lies below M1M2 <=> F(M) > 0.
To determine the location of M we consider the sign of the constant .
+/ If , M overlying M1M2 then Q is below M ie we take the point S
+/ If , M belonging to or under M1M2 then Q is located on M we obtain P News
Now we calculate the initial value P1.
I noticed Midpoint algorithm for computing with identical results Breshenham algorithm to build a simple but much more.
Flowchart algorithm, code illustrates exactly the same algorithm Breshenham
0 responses on [School_ĐHMT] Midpoint algorithm to draw the line