Jump to content

Talk:Xiaolin Wu's line algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 86.197.36.160 (talk) at 21:55, 7 April 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The extension to cover nearly-vertical lines is trivial, and left as an exercise for the reader.

Doesn't get any more aloof than that, gentlemen.

Indeed it doesn't, and could frustrate someone coming to Wikipedia for algorithm help (I know I have). If they haven't studied Bresenham's algorithm the way to fix it may not be so obvious. I'll edit the article.

This Article needs some Images.

Maybe even readers not able to use a compiler themselves may want to know what it looks like...

Typo in code?

   // check that x1 < x2
   if x2 < x1
       swap x1, x2

Surely just swapping x1 and x2 creates a mirror-image of the line? Shouldn't y1 and y2 also be swapped?

This is what is done in Bresenham's_line_algorithm:

    if x0 > x1 then
        swap(x0, x1)
        swap(y0, y1)

The nearly-horizontal case

"the nearly-horizontal case (Δx > Δy)"

makes more sense (to me) if it would read

"the nearly-horizontal case (Δx ≫ Δy)"

Am I missing something obvious here?