HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Mapping spherical coordinates onto faces of an icosahedron

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
facescoordinatessphericalontoicosahedronmapping

Problem

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.

Solution

The approach in your comment certainly works, and is probably your best bet.

If you think of the Platonic solid centred at the origin, then the coordinates of a a point located at the centre of each face is equal (up to normalisation) to those of a vector normal to the face. So you can, in principle, take a point on the sphere, search all the faces and find the face/normal whose dot product with the coordinates of the point is greatest.

This is surprisingly efficient on modern hardware, because it can use vector instructions effectively.

Do be careful about the fact that the Earth is not spherical. I don't know how these cartographic map projections deal with this (it may not matter with paper maps), but I imagine you would use the normal to the ellipsoid rather than the coordinates of the point on the ellipsoid.

Interestingly, mapping a normal vector to an octahedron is a particularly interesting case because an octahedron can be unfolded into a square. This is such an important problem that there are even survey papers on the topic.

Context

StackExchange Computer Science Q#134080, answer score: 3

Revisions (0)

No revisions yet.