algorithms – Mapping spherical coordinates onto faces of an icosahedron

I’m looking for an algorithm which takes spherical coordinates (say lat-long) and identifies which face of an icosahedron a ray moving in that direction would intersect.

My end goal here is to explore various cartographic map projections from a sphere onto an icosahedron (ex: Gnomic, Fuller Dymaxion, Snyder equal-area). All of these begin with the problem of identifying which face of the icosahedron a given coordinate belongs to and then mapping a standardized spherical triangle onto a standardized flat triangle.