public virtual void TileYToLatitudeTest() { foreach (int tileSize in TILE_SIZES) { for (sbyte zoomLevel = ZOOM_LEVEL_MIN; zoomLevel <= ZOOM_LEVEL_MAX; ++zoomLevel) { double latitude = MercatorProjection.TileYToLatitude(0, zoomLevel); Assert.AreEqual(MercatorProjection.LATITUDE_MAX, latitude, 0); latitude = MercatorProjection.TileYToLatitude(0, MercatorProjection.ZoomLevelToScaleFactor(zoomLevel)); Assert.AreEqual(MercatorProjection.LATITUDE_MAX, latitude, 0); long tileY = MercatorProjection.GetMapSize(zoomLevel, tileSize) / tileSize; latitude = MercatorProjection.TileYToLatitude(tileY, zoomLevel); Assert.AreEqual(MercatorProjection.LATITUDE_MIN, latitude, 0); tileY = MercatorProjection.GetMapSizeWithScaleFactor(MercatorProjection.ZoomLevelToScaleFactor(zoomLevel), tileSize) / tileSize; latitude = MercatorProjection.TileYToLatitude(tileY, MercatorProjection.ZoomLevelToScaleFactor(zoomLevel)); Assert.AreEqual(MercatorProjection.LATITUDE_MIN, latitude, 0); } } }