Commit cdccc8b9 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

BUG: fix radius of vertices

parent 22d041f9
......@@ -607,13 +607,13 @@ class VertexRequest(FieldRequest):
:return: scalar or (npos, ) array with the maximal distance from the center.
"""
offset = self.triangles - self.center()[..., None]
radius = (offset ** 2).sum(-1)
return sp.sqrt(radius.max(-1))
radius = (offset ** 2).sum(-2)
return sp.sqrt(radius.max())
def center(self, ):
"""Center of mass of the request
:return: (npos, 3) array with the center of mass
:return: (npos, ndim) array with the center of mass
"""
return self.triangles.mean(-1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment