comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: area enclosed by a poylgon on a sphere
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: area enclosed by a poylgon on a sphere [message #16531] Wed, 04 August 1999 00:00
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Ronn Kling, ronn@rlkling.com writes:

> I found out how to do this today. For a spherical
> triangle the solid angle subtended is the sum (in
> radians) of the interior angles - Pi.

I'm sure you probably know this, but it's worth pointing out that
the 'interior angles' are those measured on the surface of the sphere,
and not the angles between chords joining the points. That is, you
can't plug the cartesian coordinates of your vertices into the
familiar vector formulea for angles and distances. Instead, you have
to construct the two great circles which bound each vertex and
calculate the complement of the angle between their normal vectors.
For small areas on a large sphere it makes no difference, but the case
of three points spaced equally around, and just north of, the equator
makes the distinction clear: one method gives you zero, the other
gives 2*pi.

One of the public IDL libraries (idlastro I *think*) has useful
utility routines for great circle calculations.


Struan
Re: area enclosed by a poylgon on a sphere [message #16542 is a reply to message #16531] Tue, 03 August 1999 00:00 Go to previous message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Ronn Kling, ronn@rlkling.com writes:

> I need to be able to find the area enclosed by an
> arbitrarily shaped series of lat/lon points on the surface
> of the Earth. I have been told that I can solve this using
> Green's Theorem, but before I gut through the math I was
> hoping that someone would have solved this and be willing to
> share the code. If it is already in IDL that would be
> great, but any language will do.

No code, but an idea which essentially uses Green's Theorem.

1) convert lat/lon to cartesian coords
2) use them to make an IDLgrPolygon object
3) use the IDLgrTessellator object to turn that
into a set of triangles
4) for each triangle work out the solid angle it
subtends from the centre of the earth
5) add up the solid angles and convert to an
area.

Working out the solid angle subtended by an arbitrary
triangle of points on the surface of a sphere is left as an
exercise for the reader (watch out for triplets of points on
the same great circle :-).


Struan
Re: area enclosed by a poylgon on a sphere [message #16543 is a reply to message #16542] Tue, 03 August 1999 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Nick Bower <nick.bower@ssec.wisc.edu> writes:
>
>
>> I need to be able to find the area enclosed by an arbitrarily shaped
>> series of lat/lon points on the surface of the Earth. I have been told
>> that I can solve this using Green's Theorem, but before I gut through
>> the math I was hoping that someone would have solved this and be willing
>> to share the code. If it is already in IDL that would be great, but any
>> language will do.
>
> What does area in lat's and lon's mean? Since there is no unique
> "square lat/lon" area unit, you'd have to use a projection at some point
> I would guess. Don't have any code then for the area - always used
> ArcView for this type of thing. But maybe it's possible to project,
> pick a point inside a *convex* polygon, connect it with each vertex and
> find the summed area of triangles. You'd end up with an area, but it's
> specific to your spheroid/projection pair. Sorry if it's not what
> you're after, as there's a real chance you won't have a convex shape.

My guess is that he's after the area of the surface defined by the
lat/lon points on the sphere (I assume boundary lines joining the
points would be great circles). This is equivalent to finding the
solid angle enclosed by the points.

There is a relatively simple formula involving a sum of vector cross
products which compute the area of any planar polygon, so there must
be an analogous form on the surface of a sphere. Unfortunately, it
doesn't come to mind immediately.

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: area enclosed by a poylgon on a sphere [message #16545 is a reply to message #16542] Tue, 03 August 1999 00:00 Go to previous message
Nick Bower is currently offline  Nick Bower
Messages: 43
Registered: June 1999
Member
> I need to be able to find the area enclosed by an arbitrarily shaped
> series of lat/lon points on the surface of the Earth. I have been told
> that I can solve this using Green's Theorem, but before I gut through
> the math I was hoping that someone would have solved this and be willing
> to share the code. If it is already in IDL that would be great, but any
> language will do.

What does area in lat's and lon's mean? Since there is no unique
"square lat/lon" area unit, you'd have to use a projection at some point
I would guess. Don't have any code then for the area - always used
ArcView for this type of thing. But maybe it's possible to project,
pick a point inside a *convex* polygon, connect it with each vertex and
find the summed area of triangles. You'd end up with an area, but it's
specific to your spheroid/projection pair. Sorry if it's not what
you're after, as there's a real chance you won't have a convex shape.

nick

--

Nick Bower
Space Science and Engineering Center
University of Wisconsin - Madison
http://arm1.ssec.wisc.edu/~nickb
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Meteorology
Next Topic: Signal processing in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:18:51 PDT 2025

Total time taken to generate the page: 0.00691 seconds