From: Eric Mahurin Date: 2008-04-22T11:31:03+09:00 Subject: Re: [QUIZ] Triangle Area (#160) ------=_Part_18179_24779986.1208831462830 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline http://en.wikipedia.org/wiki/Polygon Here is a solution using the above that could be used for a simple polygon with an arbitrary # of points: def area p0 = @c area2 = 0 [@a, @b, @c].each { |p| area2 += p0[0]*p[1]-p[0]*p0[1] p0 = p } (area2/2.0).abs end ------=_Part_18179_24779986.1208831462830--