Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static double getLong(int inX, int zoom) { double x = Math.floor(inX * 256); double longitude = ((x * 360) / (256 * Math.pow(2, zoom))) - 180; while (longitude > 180.0) { longitude -= 360.0; } while (longitude < -180.0) { longitude += 360.0; } return longitude; } }