Find the bounding box of a Slippy Map tile

Hello everybody

In my application I need to know the Lat, Long of the corners of a tile knowning its x,y offsets as well as the zoom

Using the tool in page:

http://almien.co.uk/OSM/Tools/Coord/

I can easily type x and y as well as the zoom, and I get all the info I need (tile corners, tile size and dimensions)

I was wondering if anybody could provide me with the formula that the tool uses to find the tile corners (especially the lat part).

( I am using the inverse Mercator projection equation as follows: Lat (in degrees) = 180/PI * ATAN( SINH(yTile/2**z)) but it does not produce something valid )

Thanks in advance

George

almien says : put “source.php” on the end of the URL