I need a function to convert from tile pixels (x, y) from the Web Mercator projection (aka EPSG::3857 or SRID 900913), to longitude and latitude.
I'd like the function to be written in pseudo-code or a language like C. I'm writing a C++ program.
I apologize if this is a duplicate question but I'm having trouble finding the algorithm.
I have found an algorithm that converts longitude and latitude to tile pixels. But I'm not confident that I can rewrite it to do the opposite.