Skip to content

Commit

Permalink
add a Cluster.center() method
Browse files Browse the repository at this point in the history
  • Loading branch information
craigds committed Oct 25, 2011
1 parent 45163b2 commit 1da7c09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pygvm/__init__.py
Expand Up @@ -31,7 +31,10 @@ def __init__(self, clusters):
self.pairs = []

def center(self):
return self.m1 / self.mass
if self.mass:
return [coord / self.mass for coord in self.m1]
else:
return self.m1[:]

def clear(self):
"""
Expand Down

0 comments on commit 1da7c09

Please sign in to comment.