You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement an accurate and efficient spherical triangle area calculation using Eriksson’s formula #1585
Hi @hongyuchen1030, thank you for posting this and pointing me to it to take a look! Some initial thoughts:
Would face_node_angles from #1566 possibly enable more accurate face_areas computations for all faces, not just triangles, as per @rajeeja's suggestion there to compare spherical excess with the computed areas? The process could shift from "use quadrature" to "sum angles in face, apply formula to compute face area from spherical excess."
Alternatively, I wonder, is there any nice way to generalize Eriksson's formula to apply to non-triangles as well?
Either way, for triangles Eriksson's formula looks more efficient than computing all the angles individually, because there is only one trig function called here.
Hi @hongyuchen1030, thank you for posting this and pointing me to it to take a look! Some initial thoughts:
Would face_node_angles from #1566 possibly enable more accurate face_areas computations for all faces, not just triangles, as per @rajeeja's suggestion there to compare spherical excess with the computed areas? The process could shift from "use quadrature" to "sum angles in face, apply formula to compute face area from spherical excess."
Alternatively, I wonder, is there any nice way to generalize Eriksson's formula to apply to non-triangles as well?
Either way, for triangles Eriksson's formula looks more efficient than computing all the angles individually, because there is only one trig function called here.
These are all great questions. I provide a more detailed discussion in Section 5.10, “Face-level: Spherical face triangulation and face area,” of my paper:
To summarize the main points mentioned in the issue description above:
Spherical excess is the area of a spherical polygon on the unit sphere.
There are several formulas for calculating spherical excess. The most direct approach is to compute the interior angle at each vertex, which is likely the connection you noticed with #1566. However, this approach is known to have poor numerical accuracy and is therefore not commonly used in most software implementations. I discuss this issue in more detail in the paper referenced above.
Quadrature is not considered a best-practice method for spherical area calculation. The current quadrature-based implementation is intended only as a placeholder.
This formula applies only to spherical triangles, as does the current quadrature-based method. In computational geometry, a common approach is still to triangulate a spherical face first and then compute the area of each triangle.
That said, it is possible to calculate the area of an arbitrarily shaped spherical face, provided that all boundary edges are great-circle arcs, using the pre-quantization method described in Theorems 3.4 and 3.5 of the paper shown below. I am including it in case you are interested. As noted in my paper, these formulas are relatively recent, and their performance and numerical accuracy have not yet been thoroughly benchmarked. https://epubs.siam.org/doi/full/10.1137/23M1565255
The most direct approach is to compute the interior angle at each vertex, which is likely the connection you noticed with 1566. However, this approach is known to have poor numerical accuracy and is therefore not commonly used in most software implementations.
Ah, I didn't realize it had poor accuracy for these purposes, that is helpful to know.
it is possible to calculate the area of an arbitrarily shaped spherical face, provided that all boundary edges are great-circle arcs, using the pre-quantization method described in Theorems 3.4 and 3.5 of the paper…
The paper's notation is a bit difficult for me to parse at a glance, but it is exciting that such formulas exist! If ends up making sense to try implementing them, instead of just using triangulation plus Eriksson's formula, I would be interested to take a closer look. I will keep you posted if that ends up happening, especially if I get stuck on any parts of the paper at that point.
The most direct approach is to compute the interior angle at each vertex, which is likely the connection you noticed with 1566. However, this approach is known to have poor numerical accuracy and is therefore not commonly used in most software implementations.
Ah, I didn't realize it had poor accuracy for these purposes, that is helpful to know.
it is possible to calculate the area of an arbitrarily shaped spherical face, provided that all boundary edges are great-circle arcs, using the pre-quantization method described in Theorems 3.4 and 3.5 of the paper…
The paper's notation is a bit difficult for me to parse at a glance, but it is exciting that such formulas exist! If ends up making sense to try implementing them, instead of just using triangulation plus Eriksson's formula, I would be interested to take a closer look. I will keep you posted if that ends up happening, especially if I get stuck on any parts of the paper at that point.
This paper provides the most up-to-date overview of spherical geometry algorithms for geoscience regridding. It explains the definition of each geometric object and the recommended algorithms for each step. The goal is for UXarray to eventually implement all of the recommended algorithms from this paper. In other words, this paper serves as UXarray’s algorithmic documentation. And feel free to let me know if you have any problems with the paper.
For the area calculation, I would recommend proceeding with the triangulation + Eriksson formula implementation first. Once we have more time, we can look into the more advanced pre-quantization method.
Activity
Sevans711 commentedon Jul 20, 2026
Hi @hongyuchen1030, thank you for posting this and pointing me to it to take a look! Some initial thoughts:
Would
face_node_anglesfrom #1566 possibly enable more accurateface_areascomputations for all faces, not just triangles, as per @rajeeja's suggestion there to compare spherical excess with the computed areas? The process could shift from "use quadrature" to "sum angles in face, apply formula to compute face area from spherical excess."Alternatively, I wonder, is there any nice way to generalize Eriksson's formula to apply to non-triangles as well?
Either way, for triangles Eriksson's formula looks more efficient than computing all the angles individually, because there is only one trig function called here.
hongyuchen1030 commentedon Jul 20, 2026
@Sevans711,
These are all great questions. I provide a more detailed discussion in Section 5.10, “Face-level: Spherical face triangulation and face area,” of my paper:
https://egusphere.copernicus.org/preprints/2026/egusphere-2026-636/egusphere-2026-636.pdf
To summarize the main points mentioned in the issue description above:
That said, it is possible to calculate the area of an arbitrarily shaped spherical face, provided that all boundary edges are great-circle arcs, using the pre-quantization method described in Theorems 3.4 and 3.5 of the paper shown below. I am including it in case you are interested. As noted in my paper, these formulas are relatively recent, and their performance and numerical accuracy have not yet been thoroughly benchmarked.

https://epubs.siam.org/doi/full/10.1137/23M1565255
Sevans711 commentedon Jul 20, 2026
Thank you for these extra details!
Ah, I didn't realize it had poor accuracy for these purposes, that is helpful to know.
The paper's notation is a bit difficult for me to parse at a glance, but it is exciting that such formulas exist! If ends up making sense to try implementing them, instead of just using triangulation plus Eriksson's formula, I would be interested to take a closer look. I will keep you posted if that ends up happening, especially if I get stuck on any parts of the paper at that point.
hongyuchen1030 commentedon Jul 20, 2026
It would probably help streamline many things if you could take a look at the paper: https://egusphere.copernicus.org/preprints/2026/egusphere-2026-636/egusphere-2026-636.pdf
This paper provides the most up-to-date overview of spherical geometry algorithms for geoscience regridding. It explains the definition of each geometric object and the recommended algorithms for each step. The goal is for UXarray to eventually implement all of the recommended algorithms from this paper. In other words, this paper serves as UXarray’s algorithmic documentation. And feel free to let me know if you have any problems with the paper.
For the area calculation, I would recommend proceeding with the triangulation + Eriksson formula implementation first. Once we have more time, we can look into the more advanced pre-quantization method.