Jump to content
Wikipedia The Free Encyclopedia

Talk:Cohen–Sutherland algorithm

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 11 months ago by Nyerguds in topic License?
This article is rated Start-class on Wikipedia's content assessment scale.
It is of interest to the following WikiProjects:
WikiProject icon This article is within the scope of WikiProject Mathematics , a collaborative effort to improve the coverage of mathematics 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.MathematicsWikipedia:WikiProject MathematicsTemplate:WikiProject Mathematicsmathematics
??? This article has not yet received a rating on the project's priority scale.

[Untitled]

[edit ]
Latest comment: 13 years ago 1 comment1 person in discussion

what is outcode is the point is on the line x=xmin or x=xmax or y=ymin or y=ymaz ? please help me

It has to be INSIDE when it's on the boundary, otherwise the loop will never terminate (unless both points are initially INSIDE.) .&checktime(2620,79,0,':'):165:1A03:73FF:FE20:3C3B (talk) 01:30, 13 November 2012 (UTC) Reply

Implementation

[edit ]
Latest comment: 3 years ago 1 comment1 person in discussion
if (!(outcode0 | outcode1)) { // Bitwise OR is 0. Trivially accept and get out of loop

Wouldn't logical OR be faster and more intuitive here? Also, shouldn't the whole algorithm be rewritten using Allman indentation style? And the last point, shouldn't we use use more structured approach? while (true) and breaks may be not friendly for beginners. My opinion. FaTony (talk)

I think the code is missing the definition of the TOP constant: const int TOP = 8; // 1000 Curiousdolphin (talk) 13:20, 28 December 2022 (UTC) Reply

License?

[edit ]
Latest comment: 11 months ago 2 comments2 people in discussion

Where was the C/C++ example source code taken from? Is there a license to go along with it? Stéphane Charette (talk) 08:54, 22 February 2017 (UTC) Reply

I was wondering the same thing. The oldest edits that add code have no references at all, and Wikipedia user edits complicate the matter further. Looking around online, a lot of sources link to a page on geeksforgeeks.org, but that page literally states it got the code from this wikipedia page. Full circle... -Nyerguds (talk) 12:34, 7 August 2025 (UTC) Reply

AltStyle によって変換されたページ (->オリジナル) /