Here you can find the source of longToX(double longitudeDegrees, double radius)
Parameter | Description |
---|---|
longitudeDegrees | the longitude in degrees |
radius | the world radius in pixels |
public static int longToX(double longitudeDegrees, double radius)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w.jav a2s.c om * @param longitudeDegrees the longitude in degrees * @param radius the world radius in pixels * @return the x value */ public static int longToX(double longitudeDegrees, double radius) { double longitude = Math.toRadians(longitudeDegrees); return (int) (radius * longitude); } }