- Notifications
You must be signed in to change notification settings - Fork15
Open
Description
Currently, the @@ operator only works for scircles (and I think spoints). It is occasionally useful to also obtain the centroid of a polygon.
I have not thought about this in depth, but Ithink it ought to be fine just to compute the mean of the vertexes; what with poles and the stitching line, this has quite a few subtleties, too. What I do in some non-DB code is this:
vertices = [numpy.array(mathtricks.spherToCart(p.x, p.y))for p in self.points]center = numpy.average(vertices, axis=0)center = center/(center@center)return mathtricks.cartToSpher(center)
– that is, I'm taking the mean of the unit sphere coordinates of the vertices and then convert the resulting vector (after normalisation) to spherical coordinates. Do people think this is the right way to do that?
Metadata
Metadata
Assignees
Labels
No labels