001package algs32.kdtree;
002
003/* ***********************************************************************
004 *  Compilation:  javac Generator.java
005 *  Execution:    java Generator N
006 *  Dependencies:
007 *
008 *  Creates N random points in the unit square and print to standard output.
009 *
010 *  % java Generator 5
011 *  0.195080 0.938777
012 *  0.351415 0.017802
013 *  0.556719 0.841373
014 *  0.183384 0.636701
015 *  0.649952 0.237188
016 *
017 *************************************************************************/
018
019public class Generator {
020
021        public static void main(String[] args) {
022                args = new String [] { "500" };
023                final int N = Integer.parseInt(args[0]);
024                for (int i = 0; i < N; i++) {
025                        final double x = Math.random();
026                        final double y = Math.random();
027                        System.out.format("%8.6f %8.6f\n", x, y);
028                }
029        }
030}