MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: computing the area inside a contour plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57615] Re: [mg57580] computing the area inside a contour plot
  • From: "Caffa Vittorio Dr." <Caffa at iabg.de>
  • Date: Thu, 2 Jun 2005 05:16:51 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

The following function can be used to compute the area of a polygon:

PolygonArea::usage = "PolygonArea[{pt1, 
    pt2, ...}]  gives the area of a polygon. The area is defined to be
positive if the points are arranged in a counterclockwise order.";

PolygonArea[pnts : {{_, _} ..}] := Module[{x, y},
    {x, y} = Transpose[pnts];
    1/2Total[x RotateLeft[y] - RotateLeft[x]y]]

PolygonArea[{{0, 0}, {4, 0}, {3, 2}}]
4

See also: http://mathworld.wolfram.com/Polygon.html

Cheers, Vittorio

>-----Original Message-----
>From: I. I. [mailto:ibrahiim at email.uc.edu]
To: mathgroup at smc.vnet.net
>Sent: Wednesday, June 01, 2005 12:03 PM
>Subject: [mg57615] [mg57580] computing the area inside a contour plot
>
>hi,
>
>I have a plot of data points on a set of x and y coordinate axes.
These
>data points form a contour (it sort of looks like a "blob" of points).
I
>would like to compute the area inside this contour using Mathematica.
Any
>help would be really appreciated.
>
>
>Thank you,
>
>I. I.


  • Prev by Date: Re: Partition Function
  • Next by Date: Re: label origin on plot
  • Previous by thread: Re: computing the area inside a contour plot
  • Next by thread: Re: Log function