I am reading the book An introduction to raytracing by Eric Haines and it mentions an algorithm to map a point from a sphere into a UV plane, it calls it Inverse Spherical Mapping (page 49). I googled a lot about this term and could not find a single piece of information regarding it.
Given the normal to a point on a sphere (Sn) and the sphere's north pole unit vector (Sp) and a unit vector from the sphere's origin to the sphere's equator (Se) as shown below
Using the right-hand coordinates system. It drives the following formula for v and u
I understand the Dot product yields cosine of an angle between two vectors, but why -Sn? from the picture v starts from the south pole and varies towards the north, but why the minus sign? (the book mentions v varies from -Sp to +Sp )
As for u I am not sure why we do divide by sine phi. and why do we take the cross product to determine u? (I know the cross-product gives us a perpendicular vector to both, which is probably used to know on which side the normal is, but I am not sure exactly how that worked as the equator is changing, so it can be both right and left)