Here you can find the source of longToX(double longitudeDegrees, double radius)
public static int longToX(double longitudeDegrees, double radius)
//package com.java2s; //License from project: LGPL public class Main { public static int longToX(double longitudeDegrees, double radius) { double longitude = Math.toRadians(longitudeDegrees); return (int) (radius * longitude); }//from w w w . j a v a 2 s .co m }