Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement @@spoly #129

Open
Open
@msdemlei

Description

@msdemlei

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp