Xiaolin Wu's line algorithm: Difference between revisions

Content deleted Content added
Algorithm: Fixes incorrect rendering of endpoints. Previously, integer endpoints were rendered at 50% brightness rather than 100%, contrary to Wu’s original 1991 algorithm.
m Algorithm: Remove unused round() function, no longer needed after endpoint fix.
Line 25:
function ipart(x) is
return floor(x)
 
function round(x) is
return ipart(x + 0.5)
 
// fractional part of x