---
title: "Point clipping and Cohen-Sutherland (5,130)-(50,5)"
subject: "Computer Graphics"
chapter: 3
key: "semester_5/computer_graphics:cohen-sutherland-point-clip-5-130"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/cohen-sutherland-point-clip-5-130
site: BCT Engineering
---

# Point clipping and Cohen-Sutherland (5,130)-(50,5)

Computer Graphics · Chapter 3: Two –Dimensional Transformations

- Asked in: 2072 Chaitra, 10 marks
- Video: [Cohen Sutherland Line Clipping Example  | CG | Computer Graphics | Lec-35 | Bhanu priya](https://www.youtube.com/watch?v=21drINjp2dg) — Education 4u
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/cohen-sutherland-point-clip-5-130
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-3

## Question

What are the conditions for a point clipping? Find the clipped region of the line with endpoints (5, 130) and (50, 5) in a rectangular window with (10, 10) and (100, 100) diagonal vertices using Cohen-Sutherland line clipping algorithm.

## Short answer

A point must satisfy xwmin≤x≤xwmax and ywmin≤y≤ywmax to be visible. Using Cohen-Sutherland on line (5,130)-(50,5) with window (10,10)-(100,100), the clipped endpoints are (15.8,100) and (48.2,10).

## Answer

#### Conditions for point clipping
A point (x, y) is displayed only if it lies inside the window:

**xwmin ≤ x ≤ xwmax and ywmin ≤ y ≤ ywmax**

If any condition is violated, the point is clipped.

#### Line clipping
**Given:** P1(5,130), P2(50,5); window (10,10) to (100,100): xmin = 10, ymin = 10, xmax = 100, ymax = 100.

Region code (T B R L): bit 1 = 1 if x < xmin, bit 2 = 1 if x > xmax, bit 3 = 1 if y < ymin, bit 4 = 1 if y > ymax. Slope m = (y2 − y1)/(x2 − x1); intersections: y = y1 + m(x − x1) with a vertical edge, x = x1 + (y − y1)/m with a horizontal edge.

Slope m = (5 − 130)/(50 − 5) = −125/45 = −2.778.

Region codes (T B R L): P1 = 1001, P2 = 0100.

```text
P1=(5,130) code 1001; P2=(50,5) code 0100
Clip P1 against x = xmin = 10: new point (10,116.11)
P1=(10,116.11) code 1000; P2=(50,5) code 0100
Clip P1 against y = ymax = 100: new point (15.8,100)
P1=(15.8,100) code 0000; P2=(50,5) code 0100
Clip P2 against y = ymin = 10: new point (48.2,10)
P1=(15.8,100) code 0000; P2=(48.2,10) code 0000
Both codes 0000: accept
```

Clipped line: (15.8, 100) to (48.2, 10).

Details: at x = 10, y = 130 + m(10 − 5) = 116.11. At y = 100, x = 5 + (100 − 130)/m = 15.8. At y = 10 (P2 side), x = 50 + (10 − 5)/m = 48.2.

**Answer: the visible part of the line is from (15.8, 100) to (48.2, 10).**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. When is a point (x,y) displayed?
   A. xwmin ≤ x or ywmin ≤ y
   B. x ≥ xwmax and y ≥ ywmax
   C. xwmin ≤ x ≤ xwmax and ywmin ≤ y ≤ ywmax
   D. x + y within the window
   Answer: C. Both coordinates must lie inside the window limits. (Key point: Point clipping condition)

2. What is the region code (T B R L) of P1(5,130) for window 10-100?
   A. 0101
   B. 1000
   C. 0110
   D. 1001
   Answer: D. y > 100 gives top and x < 10 gives left, so 1001. (Key point: Region code)

3. Why does P1 need two clips?
   A. After clipping against x = 10 it is still above the window
   B. The slope is positive
   C. P2 is outside
   D. The window is too small
   Answer: A. The point (10, 116.11) still has code 1000, so it is clipped against y = 100. (Key point: Clipping order)

4. What is the final clipped line?
   A. (10, 116.11) to (50, 5)
   B. (15.8, 100) to (48.2, 10)
   C. (10, 100) to (50, 10)
   D. (5, 130) to (48.2, 10)
   Answer: B. P1 moves to (15.8,100) and P2 to (48.2,10). (Key point: Result)

## Related in Computer Graphics

- [Cohen-Sutherland: window (10,10)-(40,40)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acohen-sutherland-window-10-40) — Computer Graphics, chapter 3
- [Cohen-Sutherland line clipping](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acohen-sutherland-explain) — Computer Graphics, chapter 3, asked 2×
- [Cohen-Sutherland: two lines vs window A-D](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acohen-sutherland-two-lines-window-a) — Computer Graphics, chapter 3
- [Cohen-Sutherland: (0,120)-(130,5)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acohen-sutherland-p1-0-120) — Computer Graphics, chapter 3
- [Conditions for point clipping](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Apoint-clipping-conditions) — Computer Graphics, chapter 3, asked 2×
