Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static double calculateMinZoomLevel(int width, int height, int tileSize) {
        int max = Math.max(width, height);
        int tilesCount = (int) Math.ceil(1d * max / tileSize);
        return Math.ceil(Math.log(tilesCount) / Math.log(2d));
    }
}