
/* 
 * This file Copyright 2001 Jeffrey B Putnam
 * Please Contact me - jefu@eou.edu - for information 
 */   
import java.util.Random ; 

class RWalk
{
    static public void main (String args[]) 
    {
	Random rnd = new Random() ; 
	double x = 0 ;
        double y = 0 ; 
        double theta = 0 ; 
	int print_freq = 1 ; 

	for (int i = 0 ; i < 100000 ; i++)
	{
	    theta += rnd.nextGaussian() / 10.0 ; 
	    double r = rnd.nextGaussian() ; 
            x = x + r * Math.cos(theta) ; 
            y = y + r * Math.sin(theta) ; 

	    // System.out.println("x=" + x + " y=" + y) ; 

	    System.out.println("" + x + " " + y) ; 
	    if (false)
	    {
	        if (i % print_freq == 0)
	        { 
	    	    System.out.println(Math.sqrt(x*x+y*y)) ; 
		}
	    }
	}
    }
} 
