From f7bcfa39c174bf24f27018980143135dc9a8a26b Mon Sep 17 00:00:00 2001 From: mdroe Date: Thu, 7 Jun 2012 17:08:42 +0000 Subject: Make area calculation more accurate by not counting the first point twice when doing centroid calculation git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@17220 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 1da94015b873da448961df3bc950a6b1a5cd51ae --- lib/polygon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/polygon.py') diff --git a/lib/polygon.py b/lib/polygon.py index 0d8438c..fc4dad7 100644 --- a/lib/polygon.py +++ b/lib/polygon.py @@ -427,7 +427,7 @@ class SphericalPolygon(object): points = self._points.copy() # Rotate polygon so that center of polygon is at north pole - centroid = np.mean(points, axis=0) + centroid = np.mean(points[:-1], axis=0) centroid = vector.normalize_vector(*centroid) points = self._points - (centroid + np.array([0, 0, 1])) vector.normalize_vector( -- cgit