<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Random point in circle</title>
	<atom:link href="http://www.gamerendering.com/2009/03/26/random-point-in-circle/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gamerendering.com/2009/03/26/random-point-in-circle/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 23:27:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: billy</title>
		<link>http://www.gamerendering.com/2009/03/26/random-point-in-circle/comment-page-1/#comment-476</link>
		<dc:creator>billy</dc:creator>
		<pubDate>Fri, 15 May 2009 12:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamerendering.com/?p=603#comment-476</guid>
		<description>The best is asking a Mathematician
http://mathworld.wolfram.com/DiskPointPicking.html

Second, if you want to use that in a Montecarlo simulation (Ask an Engeneer) and he/she&#039;ll probaby respond: use Mersenne Twister (periodicity of any sequence is about 2^19937 iterations, nice, VERY nice). Also (and obvious) won&#039;t appear the unpleasant Marsaglia Effect.

And last, the method that the author has posted is the BASIS of the russian roulette that&#039;s perfect when multidimensional analisis is required, i.e. BRDF of four, five or even six dimensions.</description>
		<content:encoded><![CDATA[<p>The best is asking a Mathematician<br />
<a href="http://mathworld.wolfram.com/DiskPointPicking.html" rel="nofollow">http://mathworld.wolfram.com/DiskPointPicking.html</a></p>
<p>Second, if you want to use that in a Montecarlo simulation (Ask an Engeneer) and he/she&#8217;ll probaby respond: use Mersenne Twister (periodicity of any sequence is about 2^19937 iterations, nice, VERY nice). Also (and obvious) won&#8217;t appear the unpleasant Marsaglia Effect.</p>
<p>And last, the method that the author has posted is the BASIS of the russian roulette that&#8217;s perfect when multidimensional analisis is required, i.e. BRDF of four, five or even six dimensions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mini</title>
		<link>http://www.gamerendering.com/2009/03/26/random-point-in-circle/comment-page-1/#comment-305</link>
		<dc:creator>mini</dc:creator>
		<pubDate>Sat, 09 May 2009 10:54:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamerendering.com/?p=603#comment-305</guid>
		<description>It depends on what your random functions are, just use Mersenne twister pseudo-random number generator and you wont have any problems. The non-uniform things can be dealt with.</description>
		<content:encoded><![CDATA[<p>It depends on what your random functions are, just use Mersenne twister pseudo-random number generator and you wont have any problems. The non-uniform things can be dealt with.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max</title>
		<link>http://www.gamerendering.com/2009/03/26/random-point-in-circle/comment-page-1/#comment-69</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Thu, 02 Apr 2009 17:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamerendering.com/?p=603#comment-69</guid>
		<description>mini, SomeGuy&#039;s solution has non-uniform distribution (it&#039;ll
produce more points near the center), as Robert already noted.

May I also remind you, that sin and cos can be computed
simultaneously up to a very good precision while using
only six multiplications.

As for your solution, I didn&#039;t look much into it, but
I&#039;m quite sure that it has non-uniform distribution.</description>
		<content:encoded><![CDATA[<p>mini, SomeGuy&#8217;s solution has non-uniform distribution (it&#8217;ll<br />
produce more points near the center), as Robert already noted.</p>
<p>May I also remind you, that sin and cos can be computed<br />
simultaneously up to a very good precision while using<br />
only six multiplications.</p>
<p>As for your solution, I didn&#8217;t look much into it, but<br />
I&#8217;m quite sure that it has non-uniform distribution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mini</title>
		<link>http://www.gamerendering.com/2009/03/26/random-point-in-circle/comment-page-1/#comment-68</link>
		<dc:creator>mini</dc:creator>
		<pubDate>Thu, 02 Apr 2009 11:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamerendering.com/?p=603#comment-68</guid>
		<description>if we want to find the fastest solution and doing sin, cos, sqrt etc. needs to be as minimal as it can be.

Max&#039;s solution isnt the best one here, as it uses all three of those costly functions - and it&#039;s bad. If you dont want to use the loop, then go for the algorithm that SomeGuy told us here:

angle = random(0, 360);
dist = random(0, circle_radius);
x = cos(angle) * dist;
y = sin(angle) * dist; 

Or even try my better(not the best) solution, where only one costly function is used: 

(where R - given radius):

r = random(0, R);
x = r*random(-1, 1);
y = r-2*sqrt(r*r - x*x);

any better implementations?</description>
		<content:encoded><![CDATA[<p>if we want to find the fastest solution and doing sin, cos, sqrt etc. needs to be as minimal as it can be.</p>
<p>Max&#8217;s solution isnt the best one here, as it uses all three of those costly functions &#8211; and it&#8217;s bad. If you dont want to use the loop, then go for the algorithm that SomeGuy told us here:</p>
<p>angle = random(0, 360);<br />
dist = random(0, circle_radius);<br />
x = cos(angle) * dist;<br />
y = sin(angle) * dist; </p>
<p>Or even try my better(not the best) solution, where only one costly function is used: </p>
<p>(where R &#8211; given radius):</p>
<p>r = random(0, R);<br />
x = r*random(-1, 1);<br />
y = r-2*sqrt(r*r &#8211; x*x);</p>
<p>any better implementations?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
