# area of convex polygon

**URL:** <https://boards.straightdope.com/t/area-of-convex-polygon/128760>\
**Category:** Factual Questions\
**Created:** [September 20, 2002, 9:25am UTC](https://boards.straightdope.com/t/area-of-convex-polygon/128760 "2002-09-20T09:25:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wikkit](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@Wikkit](https://boards.straightdope.com/u/Wikkit)\
**Post date:** [September 20, 2002, 9:25am UTC](https://boards.straightdope.com/t/area-of-convex-polygon/128760/1 "2002-09-20T09:25:13Z")

</div>

I need to find the area of some convex polygons for a program, whose vertices are known in the Cartesian coordinate system.

[Polygon – from MathWorld](http://mathworld.wolfram.com/Polygon.html) gives a fairly involved equation to find that area. The problem is I’m trying to KISS, and that I don’t need the equation to be able to solve for convex polygons. I don’t even need it to give an exact answer, just an educated guess that’s correct within 25% or so.

I considered making up something that just took the perimeter and some relation of side lengths (the ratio of smallest to largest, or something like that) and bashing a number out of that, since the script needs to know the side lengths anyway. But the effort to find that equation would probably outweigh any non-simplistic angst from using the true equation, so I don’t know if that’s a good idea.

So, I come to you, dopers. Any ideas? Is there a simpler equation for the area of a convex polygon if the lengths of 2\<_n_\<10 sides are already known?

The impetus for this little foray into geometry (and ultimately, the end result) was provided by (and will be given back to) an ongoing Dope conversation, if that makes any difference.

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [September 20, 2002, 10:03am UTC](https://boards.straightdope.com/t/area-of-convex-polygon/128760/2 "2002-09-20T10:03:58Z")

</div>

How about [Pick’s Theorem](http://mathworld.wolfram.com/PicksTheorem.html)?

---

<div class="post-metadata">

**Author:** ![Wikkit](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@Wikkit](https://boards.straightdope.com/u/Wikkit)\
**Post date:** [September 20, 2002, 10:20am UTC](https://boards.straightdope.com/t/area-of-convex-polygon/128760/3 "2002-09-20T10:20:54Z")

</div>

How would one go about finding all latice points on the interior of a polygon of _n_ sides whose vertices are not integers and keep it simpler than using the big polygon equation?

An interesting approach, though.

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [September 20, 2002, 2:01pm UTC](https://boards.straightdope.com/t/area-of-convex-polygon/128760/4 "2002-09-20T14:01:52Z")

</div>

Well, I was hoping that would work, I like Pick’s theorem. The only way to use Pick’s theorem that I see would be to scale it up or down to try and get the vertices as close to lattice points as possible, then live with any error you get from that, but that sounds like way to much trouble.

> [@](#):
>
> I considered making up something that just took the perimeter and some relation of side lengths (the ratio of smallest to largest, or something like that) and bashing a number out of that, since the script needs to know the side lengths anyway

That approach will definitely not work. Picture a square getting flattened out by bringing two opposite corners together–illustrating that the same sides enclosing the original square can also be used to enclose an arbitrarily small area.

Actually, that first formula on the page you linked to doesn’t really seem like it would be that bad to put into code. Just order your vertices counter-clock wise (x(1),y(1)),…,(x(n),y(n)), add up:

x(1)y(2) + x(2)y(3) + … + x(n)y(1), and add up:

y(1)x(2) + y(2)x(3) + … + y(n)x(1),

subtract the latter from the former, then divide by two.

---

<div class="post-metadata">

**Author:** ![The\_Great\_Unwashed](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/the_great_unwashed/32/4791_2.png) [@The\_Great\_Unwashed](https://boards.straightdope.com/u/The_Great_Unwashed)\
**Post date:** [September 20, 2002, 2:49pm UTC](https://boards.straightdope.com/t/area-of-convex-polygon/128760/5 "2002-09-20T14:49:01Z")

</div>

My vote’s with Cabbage, who said it all – use the formula you found, it’s precise and _not_ difficult to code.
