1

I have used "Girard's Theorem" to calculate the area of spherical polygon with great circle edges, as stated in a previous answer.

In most cases, it works fine, but I encounters a negative area case. The coordinate (lon/lat) of those vertices in counterclockwise are (radian):

5.240747351 1.016447132

5.268216612 1.067869338

5.216315614 1.072132414

5.129855176 1.00109075

5.080803026 0.950935874

5.134615486 0.9460488828

and I plotted the polygon using NCL (Sorry, I couldn't post image right now :()

As you can see, the interior angle 4 is nearly 180 degree (179.77708422692623). The calculated excess is -0.16533548347651544 in degree. Any idea? If you need to see code, I can post them later. :)

Community
  • 1
  • 1
dongli
  • 21
  • 5
  • I really don't get your point. What is the question? If you have a 0.1 degree error in _something_ you probably have to revise the precision used in your calculations. – Dr. belisarius Dec 26 '10 at 06:15
  • The question I am asking is that why do I get "negative" area in this case. I used "double" type. – dongli Dec 27 '10 at 05:58
  • I think you have an oxymoron in your title: a sphere has one side, but a polygon means "multiple sides." Also, it's *volume* and not *area*, when in terms of a 3-dimensional object. – amphetamachine Dec 27 '10 at 07:04
  • 1
    "Spherical polygon" means a polygon embedded on the surface of a sphere, see http://mathworld.wolfram.com/SphericalPolygon.html. There is no contradictory~ And it is really "area". – dongli Dec 27 '10 at 11:19

1 Answers1

1

I have figured it out! The problematic interior angle is not ~179 but ~181, due to the value range of "acos" is [0, PI]. So some judgement should be conducted for each angle (whether the calculated angle is interior or exterior).

dongli
  • 21
  • 5