# [Proj] Area of a spherical polygon

Karney, Charles ckarney at Sarnoff.com
Tue Sep 21 15:45:47 EST 2010

```> From: Mikael Rittri [Mikael.Rittri at carmenta.com]
> Sent: Tuesday, September 21, 2010 05:06
>
> Hello Charles,
> you wrote:
>
> > * the formula for A applies only if the polygon does not include a pole
> >   (if it does, then add +/- pi to the result);
>
> Don't you mean +/- 2pi ?

> > * I would be interested to know if this formula for S12 is already
> >   known.
>
> There is an article
>
> Robert D. Miller, Computing the area of a spherical polygon, Graphic
> Gems IV, chapter II.4, pages 132 - 137.  It is on books.google.com,
> but without pages 135 and 136:
>
> Your formula for S12 does not appear (in any obvious form), but
> Miller's method reminds me a little of yours. Instead of summing the
> areas between each segment and the equator, Miller sums the areas
> between each segment and a pole.  I don't know how well-conditioned
> his method is for small polygons.

Thanks for the pointer.  I have located the code that implements this
algorithm at

http://people.sc.fsu.edu/~jburkardt/cpp_src/geometry/geometry.html

routine, sphere_polygon_area_3d, in geometry.C.  This uses L'Huilier's
theorem

for the area of a spherical triangle in terms of its three sides.  If
the edge is specified by the latitudes and longitudes of its endpoints,
then this entails computing the length of the edge and substituting the
result in a somewhat elaborate formula.

In contrast, I started with the formula for the area of a spherical
triangle in terms of two sides and the included angle (on p 71 of
Todhunter).  If one vertex is the pole then the sides are the two
co-latitudes, the included angle is the longitude difference, and the
formula can be used directly without the need to calculate an
intermediate result.  My (meager) contribution is to recast the formula
to give the area between the edge and the equator.

My expectation is that this will yield more accurate results than
Miller's method.  I will benchmark both approaches to confirm or refute
this.

By the way, Miller's paper contains one geographic howler: In the
section "Geographic Particulars" he says that ellipsoidal effects can be
included for small polygons by taking the effective radius to be

r(phi) = a/sqrt(1 - e^2 * sin(phi)^2)

Surely, this should be

r(phi) = b/(1 - e^2 * sin(phi)^2)

--
Charles Karney <ckarney at sarnoff.com>
Sarnoff Corporation, Princeton, NJ 08543-5300

Tel: +1 609 734 2312
Fax: +1 609 734 2662

This message (and any attachments) contains Sarnoff proprietary information. Such information may be subject to the terms of confidentiality or other agreements. If you are not the named addressee, you should not disseminate, distribute, or copy this email. If you have received this email by mistake, please notify the sender immediately by email and delete this email from your system. If you are not the intended recipient, you are notified that disclosing, copying, distributing, or taking any action in reliance on the contents of this information is strictly prohibited.
```