ArcStache.TileUtil.TileToWorldPos C# (CSharp) Method

TileToWorldPos() public static method

Returns NW corner of the tile
public static TileToWorldPos ( long tile_x, long tile_y, long zoom ) : IPoint
tile_x long
tile_y long
zoom long
return IPoint
        public static IPoint TileToWorldPos(long tile_x, long tile_y, long zoom)
        {
            IPoint p = new PointClass();
            double n = Math.PI - ((2.0 * Math.PI * tile_y) / Math.Pow(2.0, zoom));

            p.X = (float)((tile_x / Math.Pow(2.0, zoom) * 360.0) - 180.0);
            p.Y = (float)(180.0 / Math.PI * Math.Atan(Math.Sinh(n)));

            return p;
        }