Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Random value in a unit circle' topicStudent Support Forum > General > Archives > "Random value in a unit circle"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
09/20/07 07:01am

Each time you evaluate x and y, you get a new random value so the values used to check
x^2 + y^2 < 1 are not the same as those in {x, y}.

You could do something like this:

t2 = ListPlot[
Table[(a = x; b = y; If[a^2 + b^2 < 1, {a, b}]), {2000}]];

to set the coordinates you are working with for a given point and "record" them if they pass the test.

Tom Zeller

URL: ,

Subject (listing for 'Random value in a unit circle')
Author Date Posted
Random value in a unit circle John 09/20/07 01:40am
Re: Random value in a unit circle Forum Modera... 09/20/07 07:01am
Re: Re: Random value in a unit circle John 09/20/07 11:33am
Re: Re: Re: Random value in a unit circle Forum Modera... 09/21/07 06:52am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic