<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Area of a polygon</title>
	<atom:link href="http://dcostanet.net/wordpress/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue, 02 Dec 2008 14:01:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.4-bleeding</generator>
		<item>
		<title>By: Arti</title>
		<link>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-60990</link>
		<dc:creator>Arti</dc:creator>
		<pubDate>Sun, 13 May 2007 19:14:19 +0000</pubDate>
		<guid>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-60990</guid>
		<description>Hello

I am trying to figure out how to calculate the number of hecka lines(no two lines parallel no two lines concurrent) if they interesect 2926 times in a plane.

any ideas on how to solve this?

thanks</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>I am trying to figure out how to calculate the number of hecka lines(no two lines parallel no two lines concurrent) if they interesect 2926 times in a plane.</p>
<p>any ideas on how to solve this?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zum</title>
		<link>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-4985</link>
		<dc:creator>zum</dc:creator>
		<pubDate>Tue, 22 Aug 2006 13:20:45 +0000</pubDate>
		<guid>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-4985</guid>
		<description>It works for self-intersecting polygons, yes, but looks like the self-intersected area will be included twice.

I actually found this page while looking for a solution for the three-dimensional case (finding the volume of a closed 3-dimensional mesh defined by a set of triangles), which I later found here. The solution and the proof is here:

http://www.math.niu.edu/~rusin/known-math/95/volume.poly

My guess (to which I arrived at through some serious hand-waving) is that it can be generalized into n dimensions as:

forall (t in boundary elements) sum(det(t's vertices)) / n!</description>
		<content:encoded><![CDATA[<p>It works for self-intersecting polygons, yes, but looks like the self-intersected area will be included twice.</p>
<p>I actually found this page while looking for a solution for the three-dimensional case (finding the volume of a closed 3-dimensional mesh defined by a set of triangles), which I later found here. The solution and the proof is here:</p>
<p><a href="http://www.math.niu.edu/~rusin/known-math/95/volume.poly" rel="nofollow">http://www.math.niu.edu/~rusin/known-math/95/volume.poly</a></p>
<p>My guess (to which I arrived at through some serious hand-waving) is that it can be generalized into n dimensions as:</p>
<p>forall (t in boundary elements) sum(det(t&#8217;s vertices)) / n!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Venu</title>
		<link>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-4686</link>
		<dc:creator>Venu</dc:creator>
		<pubDate>Fri, 11 Aug 2006 00:39:14 +0000</pubDate>
		<guid>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-4686</guid>
		<description>Here is another trignometric proof.  Consider any single edge.  Then drop vertical lines onto the x-axis so that it forms a trapezoid.  Now as we move clockwise and sum the area of the trapezoids you should get the area of the polygon (note, some trapezoids have negative area using this notation).

If edge vertices are x1,y1 and x2,y2. The area of one trapezoid is: 0.5(X2Y2-X1Y1+X2Y1-X1Y2).  The first two terms cancel out as you move around a closed polygon.  Hence you are left with summation of 0.5(X2Y1-X1Y2) which is what the original author got (except for the sign).  

At first glance it also appears that it should work for self intersecting poylgons too.</description>
		<content:encoded><![CDATA[<p>Here is another trignometric proof.  Consider any single edge.  Then drop vertical lines onto the x-axis so that it forms a trapezoid.  Now as we move clockwise and sum the area of the trapezoids you should get the area of the polygon (note, some trapezoids have negative area using this notation).</p>
<p>If edge vertices are x1,y1 and x2,y2. The area of one trapezoid is: 0.5(X2Y2-X1Y1+X2Y1-X1Y2).  The first two terms cancel out as you move around a closed polygon.  Hence you are left with summation of 0.5(X2Y1-X1Y2) which is what the original author got (except for the sign).  </p>
<p>At first glance it also appears that it should work for self intersecting poylgons too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apoorva</title>
		<link>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-92</link>
		<dc:creator>Apoorva</dc:creator>
		<pubDate>Mon, 07 Nov 2005 23:19:08 +0000</pubDate>
		<guid>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-92</guid>
		<description>Good work, Haris :) ! GI and I have just a couple of small observations to make, on this:

Firstly, the assumption you quote in your last paragraph is equivalent to the existence of a triangulation for any polygon, so I think one can safely assume it.

Next, instead of "star-shaped", choose and fix ANY point [tex](a,b)[/tex] in the plane, which we use to join to each vertex. If it helps, you could even put the point in "general position", so that no two vertices are in the same line with this point. (It's not needed for the proof.)

How does this not matter in the guessing of the formula? As you say, guess the area of a triangle, formed by joining [tex](a,b)[/tex] to [tex](x_i, y_i)[/tex] - and now sum this cyclically over i. The point is that the area is just the determinant with rows [tex](1,1,1), (a, x_i, x_{i+1}), (b, y_i, y_{i+1})[/tex], and if you look at the coefficients of a,b, then they cancel out in the cyclic sum! So you are left with exactly the sum of the cross-term differences.

And finally, given that you are assuming the existence of a triangulation, you do not need to say "by induction" in proving it, once you know the guess. The moment you sum up "correctly" over any such triangulation,

(i) the areas outside the polygon cancel each other off, since they do so for every sub-summation over a triangle contained in the triangulation, and

(ii) once you sum up correctly, the triangles formed by "inside edges" also cancel each other off, being counted once each in opposite directions.

So you are left with exactly what you need - and it equals the sum of the cross-term differences.</description>
		<content:encoded><![CDATA[<p>Good work, Haris <img src='http://dcostanet.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ! GI and I have just a couple of small observations to make, on this:</p>
<p>Firstly, the assumption you quote in your last paragraph is equivalent to the existence of a triangulation for any polygon, so I think one can safely assume it.</p>
<p>Next, instead of &#8220;star-shaped&#8221;, choose and fix ANY point <img src='/wordpress/latexrender/pictures/2d05e1f15387f87456155cd96cc06235.gif' title='(a,b)' alt='(a,b)' align=absmiddle/> in the plane, which we use to join to each vertex. If it helps, you could even put the point in &#8220;general position&#8221;, so that no two vertices are in the same line with this point. (It&#8217;s not needed for the proof.)</p>
<p>How does this not matter in the guessing of the formula? As you say, guess the area of a triangle, formed by joining <img src='/wordpress/latexrender/pictures/2d05e1f15387f87456155cd96cc06235.gif' title='(a,b)' alt='(a,b)' align=absmiddle/> to <img src='/wordpress/latexrender/pictures/1e320272dee87c54a0d0c11f37f010c4.gif' title='(x_i, y_i)' alt='(x_i, y_i)' align=absmiddle/> - and now sum this cyclically over i. The point is that the area is just the determinant with rows <img src='/wordpress/latexrender/pictures/a1d2602a46a7babe3ea5a0525454b0c0.gif' title='(1,1,1), (a, x_i, x_{i+1}), (b, y_i, y_{i+1})' alt='(1,1,1), (a, x_i, x_{i+1}), (b, y_i, y_{i+1})' align=absmiddle/>, and if you look at the coefficients of a,b, then they cancel out in the cyclic sum! So you are left with exactly the sum of the cross-term differences.</p>
<p>And finally, given that you are assuming the existence of a triangulation, you do not need to say &#8220;by induction&#8221; in proving it, once you know the guess. The moment you sum up &#8220;correctly&#8221; over any such triangulation,</p>
<p>(i) the areas outside the polygon cancel each other off, since they do so for every sub-summation over a triangle contained in the triangulation, and</p>
<p>(ii) once you sum up correctly, the triangles formed by &#8220;inside edges&#8221; also cancel each other off, being counted once each in opposite directions.</p>
<p>So you are left with exactly what you need - and it equals the sum of the cross-term differences.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haris</title>
		<link>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-87</link>
		<dc:creator>haris</dc:creator>
		<pubDate>Sun, 30 Oct 2005 18:00:22 +0000</pubDate>
		<guid>http://dcostanet.net/wordpress/2005/10/29/area-of-a-polygon/#comment-87</guid>
		<description>Nice article.
It might be worth mentioning that there is a relatively easy way to check if the points are ordered in a counter-clockwise way even if they were not given as such. It's described for instance in "Introduction to Algorithms". 
It is probably not too hard to check whether the polygon is simple either, though off the top of my head I don't see if one can do it in linear time.

The formula kind of makes sense I guess. Here's another way to obtain it:

If you imagine that the polygon is star-shaped, then there is a center O such that the segments joining each vertex with O are fully contained in the polygon, Then, if we imagine that the coordinate axes are centered at O, then we can join the O to each vertex, and compute the areas of the resulting triangles. The area of the triangle formed by points i and i+1  would be half the length of the cross-products [tex]\langle x_i,y_i,0\rangle\times\langle x_{i+1},y_{i+1},0 \rangle[/tex], which is exactly what your formula says.

In fact, one can do an induction to get it in the general case (once the answer is known of course, or guessed by the reasoning above). Notice that if [tex]z_1,z_2,z_3[/tex] are consecutive points, and they are such that the triangle they form is contained in the polygon, then we can join [tex]z_1,z_3[/tex] with a straight line, and break the polygon into two polygons, one the triangle, and the other the polygon arising after omitting [tex]z_2[/tex]. Notice that the above formulas applied to the two polygons and then added give us exactly the formula for the big polygon, since they will have the term [tex]x_1y_3-y_1x_3[/tex] appearing with opposite signs, and everything else as it should be. Hence by induction that would tell us that the formula does indeed express the area of the polygon, once we know it for triangles.

All that remains now would be to show that in any polygon there should be at least three consecutive points such that the triangle they form is contained in the polygon. It is clear from the pictures, but I'm not yet 100% sure how to prove it, though I feel it should follow from the methods that tell us about the correct orientation of the vertices.</description>
		<content:encoded><![CDATA[<p>Nice article.<br />
It might be worth mentioning that there is a relatively easy way to check if the points are ordered in a counter-clockwise way even if they were not given as such. It&#8217;s described for instance in &#8220;Introduction to Algorithms&#8221;.<br />
It is probably not too hard to check whether the polygon is simple either, though off the top of my head I don&#8217;t see if one can do it in linear time.</p>
<p>The formula kind of makes sense I guess. Here&#8217;s another way to obtain it:</p>
<p>If you imagine that the polygon is star-shaped, then there is a center O such that the segments joining each vertex with O are fully contained in the polygon, Then, if we imagine that the coordinate axes are centered at O, then we can join the O to each vertex, and compute the areas of the resulting triangles. The area of the triangle formed by points i and i+1  would be half the length of the cross-products <img src='/wordpress/latexrender/pictures/f08a78de8b16b0dedfde1c6aca77caa8.gif' title='\langle x_i,y_i,0\rangle\times\langle x_{i+1},y_{i+1},0 \rangle' alt='\langle x_i,y_i,0\rangle\times\langle x_{i+1},y_{i+1},0 \rangle' align=absmiddle/>, which is exactly what your formula says.</p>
<p>In fact, one can do an induction to get it in the general case (once the answer is known of course, or guessed by the reasoning above). Notice that if <img src='/wordpress/latexrender/pictures/15d12cedba94c857ab59fd9070919861.gif' title='z_1,z_2,z_3' alt='z_1,z_2,z_3' align=absmiddle/> are consecutive points, and they are such that the triangle they form is contained in the polygon, then we can join <img src='/wordpress/latexrender/pictures/e6a740360a4b54801840033713ff678c.gif' title='z_1,z_3' alt='z_1,z_3' align=absmiddle/> with a straight line, and break the polygon into two polygons, one the triangle, and the other the polygon arising after omitting <img src='/wordpress/latexrender/pictures/99629ea640ab8364fe594e83339bd100.gif' title='z_2' alt='z_2' align=absmiddle/>. Notice that the above formulas applied to the two polygons and then added give us exactly the formula for the big polygon, since they will have the term <img src='/wordpress/latexrender/pictures/c871bcc6b13cd577c50fdb2d5b39a3f3.gif' title='x_1y_3-y_1x_3' alt='x_1y_3-y_1x_3' align=absmiddle/> appearing with opposite signs, and everything else as it should be. Hence by induction that would tell us that the formula does indeed express the area of the polygon, once we know it for triangles.</p>
<p>All that remains now would be to show that in any polygon there should be at least three consecutive points such that the triangle they form is contained in the polygon. It is clear from the pictures, but I&#8217;m not yet 100% sure how to prove it, though I feel it should follow from the methods that tell us about the correct orientation of the vertices.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
