Java Long to longToX(double longitudeDegrees, double radius)

Here you can find the source of longToX(double longitudeDegrees, double radius)

Description

long To X

License

LGPL

Parameter

Parameter Description
longitudeDegrees the longitude in degrees
radius the world radius in pixels

Return

the x value

Declaration

public static int longToX(double longitudeDegrees, double radius) 

Method Source Code

//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);
    }
}

Related

  1. longToSortableBytes(long value, byte[] result, int offset)
  2. longToStringAddress(long addr)
  3. longToStringWithZeroFill(long longValue, int width)
  4. longToTimeString(long time)
  5. longToX(double longitudeDegrees, double radius)
  6. longToX(final double longitude, final int zoom)
  7. longToZigZag(final long n)