Mail Archives: djgpp/1997/05/30/05:47:53
Alessandro Moure wrote:
> Hi all. I am developing a data manipulation tool kit and I am
> experiencing a hard time trying to find the area inside a closed,
> generic region. I have the points of the border line of the region
> stored in a vector. Does any body knows how to do it?
The most general form would be a corrolary of Green's theorem, which
allows you to calculate the area (double integral over a region) with a
line integral:
2 dA = x dy - y dx.
and integrate over the curve. If your curve is parameterized with
parameter t, you can write this as
2 dA = (x dy/dt - y dx/dt) dt,
and integrate. Since in general you won't be able to find dx/dt or dy/dt,
and possibly won't be able to antidifferentiate the right side of the
equation, you can change this to deltas and write
deltaA = (1/2) (x deltay/deltat - y deltax/deltat) deltat,
and add up the deltaA's from t = 0 to t = t' (the end of the closed
curve), and compute deltax == x(t + deltat) - x(t) and deltay == y(t +
deltat) - y(t).
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"Covenants without the sword / are but words."
/ Camden
- Raw text -