Question 67
A rectangle is bound by the lines x=0; y=0; x=5 and y=3. The line segment joining (-1, 0) and (4, 5). if clipped against this window will connect the points ______
Explanation
This is simple 2-D geometry question based on equation of line (although clipping window is given and it seems to be based on Cohen Sutherland line clipping algorithm)
We have to find the two points which are the endpoint of the line segment clipped by given rectangle window. Refer the final diagram for more understanding,
Given line segment joining (−1,0) and (4,5) and lets say new endpoints of line segment after clipping are (x,y) and (x1,y1). As all these 4 points are on the same line. So, slope of the line joining any two points is same.
So, by using equation of slope of a the line,
Slope of line = (y2 – y1) / (x2 - x1)
Lets consider point (x,y).
slope of line joining (x,y) & (-1,0) = slope of line joining (4,5) & (-1,0)
∴ (y − 0) / (x − (−1)) = (5 − 0) / (4 − (−1))
∴ y = x + 1
Now only choice A (0,1) and (2,3) satisfy above equation.
So, It conclude that, points (0, 1) and (2, 3) connect line which clipped against given rectangle window.
Hence Option 2 is the right answer.
We have to find the two points which are the endpoint of the line segment clipped by given rectangle window. Refer the final diagram for more understanding,
Given line segment joining (−1,0) and (4,5) and lets say new endpoints of line segment after clipping are (x,y) and (x1,y1). As all these 4 points are on the same line. So, slope of the line joining any two points is same.
So, by using equation of slope of a the line,
Slope of line = (y2 – y1) / (x2 - x1)
Lets consider point (x,y).
slope of line joining (x,y) & (-1,0) = slope of line joining (4,5) & (-1,0)
∴ (y − 0) / (x − (−1)) = (5 − 0) / (4 − (−1))
∴ y = x + 1
Now only choice A (0,1) and (2,3) satisfy above equation.
So, It conclude that, points (0, 1) and (2, 3) connect line which clipped against given rectangle window.
Hence Option 2 is the right answer.
Previous | Next |
UGC NET CS December 2019 - Question 66 | UGC NET CS December 2019 - Question 68 |
Thank you for sharing this.
ReplyDeleteUGC NET Coaching in Chandigarh from Gurukul Career Group, is considered to be the Best UGC NET Coaching in Chandigarh because of its erudite faculty who have got years of experience.