Here you can find the source of randomPointsFromUnitSquare(int n)
public static double[][] randomPointsFromUnitSquare(int n)
//package com.java2s; //License from project: Open Source License public class Main { public static double[][] randomPointsFromUnitSquare(int n) { if (n <= 0) { throw new IllegalArgumentException(); }/* ww w .j ava2 s .c o m*/ double[][] result = new double[n][2]; for (int i = 0; i < n; i++) { result[i][0] = Math.random(); result[i][1] = Math.random(); } return result; } }