Proposed new feature or change:
UXarray currently uses the Welz's algorithm for "centroid" calculations. However, this method applies only to certain face geometries and is not sufficiently general for all spherical mesh faces supported by UXarray.
Please consider replacing or supplementing the current implementation with a mass-centroid formulation that computes the centroid from the boundary edges of each face.
For algorithmic details and the mathematical derivation, please refer to the following papers:
Page 21, line 562-line 585, section "Centroid": https://egusphere.copernicus.org/preprints/2026/egusphere-2026-636/egusphere-2026-636.pdf
For faces whose boundaries consist entirely of great-circle arcs, this approach has an important advantage: the result does not depend on the specific shape or triangulation of the face interior. Given the oriented boundary edges, the method can compute the correct spherical mass centroid for the face.
This makes the formulation applicable to a much broader class of spherical polygons than the current Wells-based approach.
Constant-latitude edges
When a face includes one or more constant-latitude edges, the great-circle-only formulation is no longer sufficient.
For these cases, please consider applying the correction formula provided in the attached paper in Page 21 -Page 22, line 585 to line 596.
Although the constant-latitude contribution does not have a complete closed-form expression, it can still be evaluated using an appropriate numerical quadrature method.
The implementation should therefore support:
- faces bounded entirely by great-circle arcs;
- faces containing both great-circle and constant-latitude edges;
- general face shapes represented by their oriented boundary edges; and
- numerically evaluated correction terms for constant-latitude contributions.
Proposed new feature or change:
UXarray currently uses the Welz's algorithm for "centroid" calculations. However, this method applies only to certain face geometries and is not sufficiently general for all spherical mesh faces supported by UXarray.
Please consider replacing or supplementing the current implementation with a mass-centroid formulation that computes the centroid from the boundary edges of each face.
For algorithmic details and the mathematical derivation, please refer to the following papers:
Page 21, line 562-line 585, section "Centroid": https://egusphere.copernicus.org/preprints/2026/egusphere-2026-636/egusphere-2026-636.pdf
For faces whose boundaries consist entirely of great-circle arcs, this approach has an important advantage: the result does not depend on the specific shape or triangulation of the face interior. Given the oriented boundary edges, the method can compute the correct spherical mass centroid for the face.
This makes the formulation applicable to a much broader class of spherical polygons than the current Wells-based approach.
Constant-latitude edges
When a face includes one or more constant-latitude edges, the great-circle-only formulation is no longer sufficient.
For these cases, please consider applying the correction formula provided in the attached paper in Page 21 -Page 22, line 585 to line 596.
Although the constant-latitude contribution does not have a complete closed-form expression, it can still be evaluated using an appropriate numerical quadrature method.
The implementation should therefore support: