http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#lon.2Flat_to_tile_numbers

When you use this code to get the tile number you are actually doing a projection (transformation) from a lat/lon projection to spherical-mercator flat projection. So you have all the math… :slight_smile:

Anyways here you have some python code that does excatly what you want, if you manage to translate something of this into C# then please post it.

http://svn.openstreetmap.org/applications/routing/pyroute/projection.py
http://svn.openstreetmap.org/applications/routing/pyroute/tiles.py
http://svn.openstreetmap.org/applications/routing/pyroute/tilenames.py