Computer Graphics Questions & Answers – Liang-Barsky Line Clipping

This set of Computer Graphics Multiple Choice Questions & Answers (MCQs) focuses on “Liang-Barsky Line Clipping”.

1. Liang–Barsky algorithm is a __________ clipping algorithm.
a) circle
b) text
c) line
d) pixel
View Answer

Answer: c
Explanation: Liang–Barsky algorithm is a line clipping algorithm. The Liang–Barsky algorithm uses the parametric equation of a line for clipping operations.

2. The ideas of the Liang-Barsky algorithm are the same with which algorithm?
a) Cyrus Beck algorithm
b) Liam-Chopsky algorithm
c) Cohen Sutherland algorithm
d) All have the same
View Answer

Answer: a
Explanation: The ideas for clipping line of Liang-Barsky and Cyrus-Beck are the same. The only difference is Liang-Barsky algorithm has been optimized for an upright rectangular clip window.

3. Liang Barsky algorithm can be used to clip 3-D lines.
a) True
b) False
View Answer

Answer: a
Explanation: Liang Barsky algorithm can be used for 1-D lines, 2-D lines, and 3-D line clipping. This algorithm can be used for line clipping of 4-D lines too.
advertisement
advertisement

4. This algorithm uses the ____________ equations for a line and solves four inequalities.
a) linear
b) quadratic
c) cubic
d) parametric
View Answer

Answer: d
Explanation: This algorithm uses the parametric equations for a line and solves four inequalities to find the range of the parameter for which the line is in the viewport.

5. The Liang-Barsky algorithm is more efficient than the Cohen Sutherland algorithm.
a) True
b) False
View Answer

Answer: a
Explanation: Liang–Barsky clipping algorithm does as much testing as possible before computing line intersections, hence it is much more efficient than others.

6. When the line is parallel to the boundaries then what is the value of pk?
a) pk < 0
b) pk > 0
c) pk = 0
d) pk = 1
View Answer

Answer: c
Explanation: When pk < 0 line starts exceeding the boundary while if pk > 0 line is bounded inside the boundary. When the line is parallel then pk = 0.

7. Which type of arithmetic is used in Liang Barsky algorithm?
a) simple arithmetic operations
b) floating point arithmetic
c) fixed point arithmetic
d) logarithmic operations
View Answer

Answer:b
Explanation: Liang and Barsky have created an algorithm that uses floating-point arithmetic but finds the appropriate endpoints with at most four computations with use of parametric equations.
advertisement

8. When pk < 0, then the line is ___________
a) parallel to the boundaries
b) exceeding the boundaries
c) bounded inside the boundaries
d) can’t say
View Answer

Answer: b
Explanation: When pk < 0 line starts exceeding the boundary while if pk > 0 line is bounded inside the boundary. When the line is parallel then pk = 0.

9. How many inequalities are solved in this algorithm?
a) 3
b) 2
c) 1
d) 4
View Answer

Answer: d
Explanation: Liang-Barsky line clipping algorithm solves 4 inequalities to find the range of the parameter for which the line is in the intersection with the rectangle.
advertisement

10. What is the relative speed improvement over Cohen-Sutherland algorithm for 2-D lines?
a) 40%
b) 50%
c) 70%
d) 36%
View Answer

Answer: d
Explanation: The relative speed improvement over Sutherland-Cohen algorithm are: – 36% for 2D lines, 40% for 3D lines, 70% for 4D lines.

Sanfoundry Global Education & Learning Series – Computer Graphics.

To practice all areas of Computer Graphics, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.