Jump to content

Talk:Liang–Barsky algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Hazard-Bot (talk | contribs) at 02:05, 16 December 2011 (Bot, (Plugin++) Added {{WikiProject Computer graphics}}, class=Stub, auto=yes). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputer graphics Stub‑class
WikiProject iconThis article is within the scope of WikiProject Computer graphics, a collaborative effort to improve the coverage of computer graphics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Note icon
This article has been automatically rated by a bot or other tool as Stub-class because it uses a stub template. Please ensure the assessment is correct before removing the |auto= parameter.

Discuss: Removed code examples

So what was wrong with those snippets? I took a look at the first Java implementation and couldn't find much wrong with it (beyond purely stylistic issues). I only suspect that the p == 0 check will fail for most real-world scenarios due to rounding errors; it's always hard to get a round zero when dealing with floating-point numbers. Declaring a small eps factor and checking |p| < eps would remedy this, though. Is there some fundamental flaw in the explanation of the algorithm, or something else I didn't notice? What were the examples on which the implementations were tested? —Preceding unsigned comment added by 213.144.1.62 (talk) 13:50, 10 March 2011 (UTC)[reply]

Removed code examples

There were previously 3 code examples for Liang-Barsky, 2 in Java and 1 in C#, all of which failed in the case of a line intersecting a rectangle parallel to one of the edges. A correct example in pseudo-code should be added, as per the guidelines in Wikipedia:WikiProject Computer science/Manual of style (computer science). I felt it was better to remove the examples entirely than leave misleading inormation on the page.

step 2. is incorrect

step 2 should be this: If for that k, qk < 0, the line is completely outside and can be eliminated.Zaghaghi (talk) 19:53, 21 November 2010 (UTC)[reply]