SlideShare a Scribd company logo
1 of 1
Download to read offline
Cohen Sutherland Line Clipping Algorithm
Step 1 : Input the both endpoints of a line.
Step 2 : Assign a region code for two endpoints of given line.
Step 3 : Perform bitwise logical OR operation for both region codes of endpoints
Step 3.1 : If the result is 0000, then given line is completely inside (trivially accepted).
Step 3.2 : Else, perform the bitwise logical AND operation for both region codes of
endpoints.
Step 3.2.1: If the result is not 0000, then given line is completely outside (trivially
rejected).
Step 3.2.2: Else, line is the clipping candidate.
Step 3.2.2.1 : Choose an endpoint of the line that is outside the given rectangle.
Step 3.2.2.2 : Find the intersection point of the rectangular boundary (based on
region code).
Step 3.2.2.3 : Replace endpoint with the intersection point and update the
region code.
Step 3.2.2.4 : Repeat Step 2 until we find a clipped line either trivially accepted
or trivially rejected.
Step 4 : Repeat Step 1 for other lines.

More Related Content

Similar to Cohen Sutherland line clipping algorithm

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clippingMani Kanth
 
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdfKrishnaKumar2309
 
Clipping in 2 d
Clipping in 2 dClipping in 2 d
Clipping in 2 dAshiv Khan
 
Rotary encoder training material
Rotary encoder training materialRotary encoder training material
Rotary encoder training materialSáng Bùi Quang
 
Lcdf4 chap 03_p2
Lcdf4 chap 03_p2Lcdf4 chap 03_p2
Lcdf4 chap 03_p2ozgur_can
 
Computer Organization And Architecture lab manual
Computer Organization And Architecture lab manualComputer Organization And Architecture lab manual
Computer Organization And Architecture lab manualNitesh Dubey
 
DLD Lecture Unit 4 (1).pdf
DLD Lecture Unit 4 (1).pdfDLD Lecture Unit 4 (1).pdf
DLD Lecture Unit 4 (1).pdfASHISHMEHRA64
 
Computer Graphics - Windowing and Clipping
Computer Graphics - Windowing and ClippingComputer Graphics - Windowing and Clipping
Computer Graphics - Windowing and ClippingChandrakantDivate1
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxSaveraAyub2
 
3. Boolean Algebra.pptx
3. Boolean Algebra.pptx3. Boolean Algebra.pptx
3. Boolean Algebra.pptxNaveenPunia5
 
Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...
Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...
Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...IJERA Editor
 
Viterbi Decoder Plain Sailing Design for TCM Decoders
Viterbi Decoder Plain Sailing Design for TCM DecodersViterbi Decoder Plain Sailing Design for TCM Decoders
Viterbi Decoder Plain Sailing Design for TCM Decodersijtsrd
 

Similar to Cohen Sutherland line clipping algorithm (20)

Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
19BCS2605_Krishna_Kumar_Computer_Graphics_exp_3.1.pdf
 
Line clipping
Line clippingLine clipping
Line clipping
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
 
Clipping in 2 d
Clipping in 2 dClipping in 2 d
Clipping in 2 d
 
Clipping
ClippingClipping
Clipping
 
Rotary encoder training material
Rotary encoder training materialRotary encoder training material
Rotary encoder training material
 
B sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lcktB sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lckt
 
Lcdf4 chap 03_p2
Lcdf4 chap 03_p2Lcdf4 chap 03_p2
Lcdf4 chap 03_p2
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
 
Ansi
AnsiAnsi
Ansi
 
Computer Organization And Architecture lab manual
Computer Organization And Architecture lab manualComputer Organization And Architecture lab manual
Computer Organization And Architecture lab manual
 
DLD Lecture Unit 4 (1).pdf
DLD Lecture Unit 4 (1).pdfDLD Lecture Unit 4 (1).pdf
DLD Lecture Unit 4 (1).pdf
 
STLD-Combinational logic design
STLD-Combinational  logic design STLD-Combinational  logic design
STLD-Combinational logic design
 
Computer Graphics - Windowing and Clipping
Computer Graphics - Windowing and ClippingComputer Graphics - Windowing and Clipping
Computer Graphics - Windowing and Clipping
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
 
3. Boolean Algebra.pptx
3. Boolean Algebra.pptx3. Boolean Algebra.pptx
3. Boolean Algebra.pptx
 
Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...
Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...
Analysis and Implementation of Hard-Decision Viterbi Decoding In Wireless Com...
 
Viterbi Decoder Plain Sailing Design for TCM Decoders
Viterbi Decoder Plain Sailing Design for TCM DecodersViterbi Decoder Plain Sailing Design for TCM Decoders
Viterbi Decoder Plain Sailing Design for TCM Decoders
 

Recently uploaded

Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfragupathi90
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfEr.Sonali Nasikkar
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalSwarnaSLcse
 
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological universityMohd Saifudeen
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...IJECEIAES
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxMANASINANDKISHORDEOR
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashidFaiyazSheikh
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailingAshishSingh1301
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfKira Dess
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...IJECEIAES
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniR. Sosa
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...drjose256
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksIJECEIAES
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New HorizonMorshed Ahmed Rahath
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfssuser5c9d4b1
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Toolssoginsider
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdfKamal Acharya
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisDr.Costas Sachpazis
 

Recently uploaded (20)

Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney Uni
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 

Cohen Sutherland line clipping algorithm

  • 1. Cohen Sutherland Line Clipping Algorithm Step 1 : Input the both endpoints of a line. Step 2 : Assign a region code for two endpoints of given line. Step 3 : Perform bitwise logical OR operation for both region codes of endpoints Step 3.1 : If the result is 0000, then given line is completely inside (trivially accepted). Step 3.2 : Else, perform the bitwise logical AND operation for both region codes of endpoints. Step 3.2.1: If the result is not 0000, then given line is completely outside (trivially rejected). Step 3.2.2: Else, line is the clipping candidate. Step 3.2.2.1 : Choose an endpoint of the line that is outside the given rectangle. Step 3.2.2.2 : Find the intersection point of the rectangular boundary (based on region code). Step 3.2.2.3 : Replace endpoint with the intersection point and update the region code. Step 3.2.2.4 : Repeat Step 2 until we find a clipped line either trivially accepted or trivially rejected. Step 4 : Repeat Step 1 for other lines.