I am working on a Python script to:
- compute the vertex coordinates of a geodesic sphere/icosahedron,
- project the triangles onto a sphere, then
- find which spherical triangle contains an arbitrary point.
I would ultimately like to provide my script with a list of sample point coordinates, and the script would indicate which triangles contain points. These characters would then be used for presence-absence data in biological studies.
I'm mostly done, but struggling with step 3. Is there a fast algorithm to identify whether a point is contained within a spherical equilateral triangle? In two dimensions for general polygons, you can count how many times a ray crosses a perimeter, but this seems challenging to do in three dimensions since the perimeter is curved.
It seems like there should be a clever way to exploit the symmetry of spherical equilateral triangles, but I'm just not seeing it. I don't work with GIS or spherical trigonometry, so just let me know if my question is improperly phrased.