<p><em>Since this is a homework question, I'll give hints rather than a numerical answer.</em></p>

<hr>

<h1>Clipping a convex polygon</h1>

<p>Think about how many times the polygon can cross each edge of the rectangle. In general, a polygon can cross one of the edges of the rectangle an arbitrarily large number of times. How is this number reduced if the polygon is convex?</p>

<p>This will give you the maximal number of new angles that can be added per rectangle edge, which should lead you to the answer.</p>

<h1>Clipping a non-convex polygon</h1>

<p>As for your guess of 2n, even for a non-convex polygon it may not be able to reach this high. If one vertex is outside the rectangle, then in order to create 2 new vertices both of its neighbouring vertices must be inside the rectangle. This means you cannot create 2n new vertices this way.</p>

<p>The exception is when an edge of the polygon crosses 2 edges of the rectangle, for example at a corner of the rectangle. This allows creating two new vertices from a single edge. So for small enough n, it is possible to clip to a polygon with 2n vertices, but for larger n this is not possible.</p>

CC BY-SA 3.0
2016-06-26T14:42:49.290Z
2016-06-26T14:42:49.290Z
trichoplax is on Codidact now
<p>I'm trying to figure this out for my Computer Graphics course, but I find it very hard to understand. </p>

<p>I believe the minimum number of angles obtained from clipping a convex polygon with n angles is 0, for example if the polygon is outside of the clipping rectangle, but I'm not sure if this makes sense.</p>

<p>As for the maximum number of angles, I believe it is 2n, as in if every angle tip gets outside of the rectangle. However, I'm not sure about this either.</p>

CC BY-SA 3.0
2016-06-26T11:17:25.157Z
[Related](http://computergraphics.stackexchange.com/questions/2381/finding-the-maximum-number-of-disconnected-fragments) (though not a duplicate)
trichoplax is on Codidact now
CC BY-SA 3.0
2016-06-26T11:18:20.427Z
Does "clipping" in this context mean "clipping against a rectangle"?
trichoplax is on Codidact now
CC BY-SA 3.0
2016-06-26T11:57:34.617Z
Yes, that is exactly what I mean :)
Alex
CC BY-SA 3.0
2016-06-26T12:02:37.173Z
Sorry - I just realised you did mention a rectangle in your question...
trichoplax is on Codidact now
<polygon><clipping>
Maximal and minimal no. of angles obtained from clipping a convex polygon with n angles
Alex
# Maximal and minimal no. of angles obtained from clipping a convex polygon with n angles

(Asked by: username_0 on 2016-06-26)

I'm trying to figure this out for my Computer Graphics course, but I find it very hard to understand.

I believe the minimum number of angles obtained from clipping a convex polygon with n angles is 0, for example if the polygon is outside of the clipping rectangle, but I'm not sure if this makes sense.

As for the maximum number of angles, I believe it is 2n, as in if every angle tip gets outside of the rectangle. However, I'm not sure about this either.

**Tags:** polygon, clipping

> **Comments:**
> **username_1**: [Related](http://computergraphics.stackexchange.com/questions/2381/finding-the-maximum-number-of-disconnected-fragments) (though not a duplicate)  
> **username_1**: Does "clipping" in this context mean "clipping against a rectangle"?  
> **username_0**: Yes, that is exactly what I mean :)  
> **username_1**: Sorry - I just realised you did mention a rectangle in your question...  

---

## 1 answers

### Answer by username_1 on 2016-06-26. Score: 3 | Accepted answer

*Since this is a homework question, I'll give hints rather than a numerical answer.*

---

# Clipping a convex polygon

Think about how many times the polygon can cross each edge of the rectangle. In general, a polygon can cross one of the edges of the rectangle an arbitrarily large number of times. How is this number reduced if the polygon is convex?

This will give you the maximal number of new angles that can be added per rectangle edge, which should lead you to the answer.

# Clipping a non-convex polygon

As for your guess of 2n, even for a non-convex polygon it may not be able to reach this high. If one vertex is outside the rectangle, then in order to create 2 new vertices both of its neighbouring vertices must be inside the rectangle. This means you cannot create 2n new vertices this way.

The exception is when an edge of the polygon crosses 2 edges of the rectangle, for example at a corner of the rectangle. This allows creating two new vertices from a single edge. So for small enough n, it is possible to clip to a polygon with 2n vertices, but for larger n this is not possible.


---

