First, I needed to convert geographic coordinates (like those received from GPS) to global cartesian coordinates. I found an earlier question (How do I calculate a xyz-position of a gps-position relative to an other gps-position?) which worked perfectly. Now I need to go the other way around.
In Wikipedia, there are equations to convert between those, but the equations from geographic to cartesian are different, and not indicating which is latitude and which is longitude. I know it's because it's not geographic per se, and I also know that those angles have different constraints than those of latitude/longitude. This makes me not trust the reverse equations there. I searched elsewhere but I couldn't find the answer.
Precision is not important. Consider a perfect sphere.