Thanks for all the replies (and even a phone call).

There were some good sites for reference provided:

http://www.efg2.com/Lab/Graphics/PolygonArea.htm

http://www.pms.informatik.uni-muenchen.de/lehre/compgeometry/Gosper/TOC.html


I ended up using the simplest algorythm based on the following:

Area=(Sum(yi-yn+1)*(xn+xn+1))/2

Further research identified it as the algorythm that is used for planimeters, 
i think it is called the gauss-green formula.

I tried it out on a few polygons of known size and it actually worked, and 
gave comparable results to mapinfo. As the application will only ever deal 
with simple polygons,  I will go with it at present.

For anyone that is interested in the code, I used the following VB function, 
which returns an area value after passing two arrays of x and y coordinates to it.

Private Function fCalcArea(X, Y) As Single
'X and Y are arrays of x and y coordinates
Dim i As Integer
Dim rtn As Single
fCalcArea = -999
rtn = 0
For i = 1 To UBound(X) - 1
    rtn = rtn + (Y(i) - Y(i + 1)) * (X(i) + X(i + 1))
Next i
rtn = rtn / 2
fCalcArea = rtn
End Function

Thanx u all

Robert.

----------------------------
Robert Crossley
Robert Crossley and Associates
9 Short Street
NEW BRIGHTON NSW Australia 2384

P: 61-2-66801309
M:0419718642 

----------------------------




_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to