Here you can find the source of moveInRadius(double[] position, double radius)
public static double[] moveInRadius(double[] position, double radius)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadLocalRandom; public class Main { public static double[] moveInRadius(double[] position, double radius) { double[] newPosition = new double[position.length]; for (int i = 0; i < position.length; i++) { newPosition[i] = position[i] + ThreadLocalRandom.current().nextDouble(-radius, radius); }//from w w w. j a v a 2 s . c om return newPosition; } }