summaryrefslogtreecommitdiff
path: root/lib/polygon.py
diff options
context:
space:
mode:
authormdroe <mdroe@stsci.edu>2012-06-07 13:08:42 -0400
committermdroe <mdroe@stsci.edu>2012-06-07 13:08:42 -0400
commitf7bcfa39c174bf24f27018980143135dc9a8a26b (patch)
tree7fef3d178de9b387b2a2b9010c7ff2fe7b5051d8 /lib/polygon.py
parent40e93ce69ab8b6181362981250cde7de6f4033ea (diff)
downloadstsci.sphere-f7bcfa39c174bf24f27018980143135dc9a8a26b.tar.gz
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
Diffstat (limited to 'lib/polygon.py')
-rw-r--r--lib/polygon.py2
1 files changed, 1 insertions, 1 deletions
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(