Malte Brill wrote:

Hi List,


this one goes out to the math experts.
How does one compute the area ( I hope it is the correct Term for
flaecheninhalt in german) of a polygon with n sides.

(That would get me started.)

I want to extract all lines of 2 polygons by analysing their points,
evaluate the area of each of them with some magic formula I don´t know ;-)
and to figure out the area of the smallest polygon surrounding both of them.

 

Hallo Malte,
wenn sich das Polygon nicht schneidet, geht es folgendermaßen: Es wird in Dreiecke zerlegt (man nimmt ein Polygonpunkt und verbindet ihn mit allen anderen); angenommen, die Koordinaten der 3 Eckpunkte sind (ax,ay), (bx,by) und (cx,cy) dann gilt für den Flächeninhalt: F = [ax*(by - cy) + bx*(cy - ay) + cx*(ay - by)]/2.
Diese Berechnung muß nun für alle entstandenen Dreiecke durchgeführt und die Ergebnisse addiert werden.
In English:
If the polygon does not cross itself, the following method helps: the polygon has to be divided into triangulars (choose one point of the polygon and connect it with all the others); supposed, the coordinates of the three triangular points are (ax,ay), (bx,by) und (cx,cy), then the area F will be calculated with [ax*(by - cy) + bx*(cy - ay) + cx*(ay - by)]/2.
This has to be done for all the triangulars and the areas have be added and give the total area.
( I know, bad English from "old Europe")

Gruß
Gernot

<<inline: wink_n.gif>>

Reply via email to