Here you can find the source of randomGenLat(Double latstart, Double latend)
public static Double randomGenLat(Double latstart, Double latend)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; import java.util.Random; public class Main { public static final DecimalFormat df = new DecimalFormat("#.000000"); public static Double randomGenLat(Double latstart, Double latend) { Random ran = new Random(); double latdis = latend - latstart; return Double.parseDouble(df.format(ran.nextDouble() * latdis + latstart)); }/* w w w .j a va 2s. c o m*/ }