Java Decimal Format randomGenLat(Double latstart, Double latend)

Here you can find the source of randomGenLat(Double latstart, Double latend)

Description

random Gen Lat

License

Apache License

Declaration

public static Double randomGenLat(Double latstart, Double latend) 

Method Source Code


//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*/
}

Related

  1. printAngle(double angle)
  2. printArray(String title, double[] vect)
  3. printArrayP(double[][] p)
  4. PrintWith1DecAnd000Sep(double Number)
  5. randomDouble(double minDouble, double maxDouble)
  6. randomGenLngLat(Double lngstart, Double lngend, Double latstart, Double latend)
  7. readThisDouble(final String value)
  8. renderDouble(double value, int precision)
  9. replaceCommaByPoint(String doubleString, Locale loc)