Skip to content

[Feature request] finding the centroid/midPoint when having multiple points on an arc #19

@emanuelespiritowork

Description

@emanuelespiritowork

Hi there,
I have some points in the sky in spherical coordinates (lat/lon) and I have to find the center of each subgroup. The cases are:

  • when the points are the vertices of a polygon I am using your geosphere::centroid function so that I obtain the centroid. Before doing this I have to check that points are in the correct winding order and I have found a function to check it;
  • when the points are just two I am using your geosphere::midPoint function so that I obtain the midpoint that is the extension of the centroid to this case;
  • when I have multiple points (say three) on a line in the sky (for example having three points with the same latitude angle but three different longitude angles) I don't know what to use to find the equivalent of the centroid. For the project I am working on I am simply using the mean because I have to give a result but clearly is not appropriate in spherical coordinates. The geosphere::centroid in this case is not working since the polygon check fails
Image

Can you suggest me any idea to use your package for the third case? Is there any function that could be implemented to find the "center of mass" of these three points?

PS
thank you for this package, it's amazing!

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