Java Random Double generateRandomLongitude()

Here you can find the source of generateRandomLongitude()

Description

generate Random Longitude

License

Open Source License

Return

random longitude within min and max constraints

Declaration

public static double generateRandomLongitude() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final int MIN_LONG = -180;
    private static final int MAX_LONG = 180;

    /**//from w  w w. j  a v a 2 s . c  om
     * 
     * @return random longitude within min and max constraints
     */
    public static double generateRandomLongitude() {
        return MIN_LONG + (double) (Math.random() * ((MAX_LONG - MIN_LONG) + 1));

    }
}

Related

  1. generateRandomDoubleInRange(double min, double max)
  2. getDouble()
  3. getDouble()
  4. getDoubleInRange(double minValue, double maxValue)
  5. getDoubleSpecial()