# 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

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

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

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.

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

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

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

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

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.

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

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

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.

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

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]