Re: [OpenMap Users] geo - area

From: Andrew Hnatiw <Andrew_Hnatiw_at_raytheon.com>
Date: Wed, 29 Sep 2004 10:36:12 -0400

Maybe its simply calculating a signed area? This is just a guess, but the
sign might switch if you swap the order of the points you give it, like
when taking an integral between two curves in 2-space and swapping the
order of the curves. The code looks like its using cross products
everywhere, so I bet it would switch if you switched the order.

hth,
Andrew


owner-openmap-users_at_bbn.com wrote on 09/29/2004 12:54:51 AM:

> Hi,
>
> I am trying to get the area from an OMPoly using the Geo#Area function.
> I am getting negative numbers for the area. Has anyone used this
> function before? I am creating the geos for the enumeration to pass to
> the function as follows:
>
> Vector geos = new Vector();
> float[] latlons = ((OMPoly) omGraphic).getLatLonArray();
>
> for (int i = 0; i < latlons.length; i += 2) {
> Geo g = new Geo((double)latlons[i],
> (double)latlons[i+1]);
> geos.add(g);
> }
> System.out.println("getArea: num Geos: " + geos.size());
> Enumeration e = geos.elements();
> return Geo.area(e);
>
>
> does this make sense? Could there be a problem with the fact that the
> getLatLonArray() function that I use to get the lat and lons of each
> point use Radians? Looking at the website that was referenced, Radians
> seemed to make sense.
>
> Thanks for the help.
>
> - Robert
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Sep 29 2004 - 10:38:08 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT