<p>The diagram on the <a href="https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm" rel="nofollow noreferrer">Wikipedia entry for Cohen-Sutherland Clipping</a> explains it pretty well:</p>

<pre><code>        left    central right
top     1001    1000    1010
central 0001    0000    0010
bottom  0101    0100    0110
</code></pre>

<p>So in your example, <code>p1</code> would be left, central, so its code  would be 0001.</p>

<p><code>p2</code> would be central, bottom, so 0100</p>

<p><code>p3</code> would  be  central, central, so 0000</p>

<p><code>p4</code> would be central, top, so 1000</p>

CC BY-SA 4.0
2018-12-06T06:43:25.410Z
2018-12-06T06:43:25.410Z
user1118321
<p>In Cohen-Sutherland clipping, it assigns outcodes to the points on lines that are drawn to specify their orientation relative to the clipping window. </p>

<p>In the diagram below, I'm confused on what outcodes that would be assigned to p1, p2, p3, p4? Can someone explain?
<a href="https://i.sstatic.net/7oXm7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7oXm7.png" alt="enter image description here"></a></p>

<clipping>
What are the outcodes that would be assigned to these points?
user9778
# What are the outcodes that would be assigned to these points?

(Asked by: username_0 on 2018-12-06)

In Cohen-Sutherland clipping, it assigns outcodes to the points on lines that are drawn to specify their orientation relative to the clipping window.

In the diagram below, I'm confused on what outcodes that would be assigned to p1, p2, p3, p4? Can someone explain?
[![enter image description here](https://i.sstatic.net/7oXm7.png)](https://i.sstatic.net/7oXm7.png)

**Tags:** clipping


---

## 1 answers

### Answer by username_1 on 2018-12-06. Score: 2 | Accepted answer

The diagram on the [Wikipedia entry for Cohen-Sutherland Clipping](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm) explains it pretty well:

```
        left    central right
top     1001    1000    1010
central 0001    0000    0010
bottom  0101    0100    0110

```

So in your example, `p1` would be left, central, so its code would be 0001.

`p2` would be central, bottom, so 0100

`p3` would be central, central, so 0000

`p4` would be central, top, so 1000


---

