Math, circles, interior points and densities [modified]
-
I briefly considered using [MathOverflow] for this, but came to the conclusion that I'd grasp your words easier than the folks over there... The theory is this: I have a circle C of radius R and centre S. Inside this circle, I want to place N (a "big" number) points such that the density of points in the vicinity V of a point P is equal everywhere in the circle for all points. As N goes to infinity and the vicinity goes to P, the density function in both polar and cartesian coordinates becomes a constant. So, how should I approach this if I wanted to populate the circle with N points of constant density? :confused: Edit 1: QuickAnswers cannot handle "math" or "algorithm" tags... Edit 2: Solution at http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
modified on Sunday, January 10, 2010 6:12 PM
-
I briefly considered using [MathOverflow] for this, but came to the conclusion that I'd grasp your words easier than the folks over there... The theory is this: I have a circle C of radius R and centre S. Inside this circle, I want to place N (a "big" number) points such that the density of points in the vicinity V of a point P is equal everywhere in the circle for all points. As N goes to infinity and the vicinity goes to P, the density function in both polar and cartesian coordinates becomes a constant. So, how should I approach this if I wanted to populate the circle with N points of constant density? :confused: Edit 1: QuickAnswers cannot handle "math" or "algorithm" tags... Edit 2: Solution at http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
modified on Sunday, January 10, 2010 6:12 PM
Hi, You may get flamed for asking this in the Lounge; I would expect such question to fit in the Algorithms forum (which was called "Algorithms and Math" before). If you were to post there again, I will remove this message, so you then can delete yours in the Lounge. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.
-
I briefly considered using [MathOverflow] for this, but came to the conclusion that I'd grasp your words easier than the folks over there... The theory is this: I have a circle C of radius R and centre S. Inside this circle, I want to place N (a "big" number) points such that the density of points in the vicinity V of a point P is equal everywhere in the circle for all points. As N goes to infinity and the vicinity goes to P, the density function in both polar and cartesian coordinates becomes a constant. So, how should I approach this if I wanted to populate the circle with N points of constant density? :confused: Edit 1: QuickAnswers cannot handle "math" or "algorithm" tags... Edit 2: Solution at http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
modified on Sunday, January 10, 2010 6:12 PM
How about using a Sobol sequence[^] to generate the points?
I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
-
I briefly considered using [MathOverflow] for this, but came to the conclusion that I'd grasp your words easier than the folks over there... The theory is this: I have a circle C of radius R and centre S. Inside this circle, I want to place N (a "big" number) points such that the density of points in the vicinity V of a point P is equal everywhere in the circle for all points. As N goes to infinity and the vicinity goes to P, the density function in both polar and cartesian coordinates becomes a constant. So, how should I approach this if I wanted to populate the circle with N points of constant density? :confused: Edit 1: QuickAnswers cannot handle "math" or "algorithm" tags... Edit 2: Solution at http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
modified on Sunday, January 10, 2010 6:12 PM
What about using
rand()
for bothx
andy
coordinates and the discarding the point if it is external to the circle? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
What about using
rand()
for bothx
andy
coordinates and the discarding the point if it is external to the circle? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]What about using
rand()
for radius and angle and not discarding any? :)I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
-
What about using
rand()
for radius and angle and not discarding any? :)I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
Well, it is winter - it makes sense to use polar coordinates :-D
-
Hi, You may get flamed for asking this in the Lounge; I would expect such question to fit in the Algorithms forum (which was called "Algorithms and Math" before). If you were to post there again, I will remove this message, so you then can delete yours in the Lounge. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.
Ah! I looked top to bottom for "Math" and failed to see "Algorithms". Thanks!
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
Well, it is winter - it makes sense to use polar coordinates :-D
I'll bear with you while you get the puns out the way.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
What about using
rand()
for bothx
andy
coordinates and the discarding the point if it is external to the circle? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Yes, I thought about that a bit, but it felt as it would skew the density and give a wrong bias to the points with x/y values inside the circle. I cannot put words on that feeling, so it's probably plain wrong.
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
What about using
rand()
for radius and angle and not discarding any? :)I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
But that would just give a uniform distribution along a specific line through the center, which would give a higher density closer to the center. Right?
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
How about using a Sobol sequence[^] to generate the points?
I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
Thanks - I'll read up a bit on that!
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
What about using
rand()
for radius and angle and not discarding any? :)I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
That'd cause a skewed density with bias to the center. Found a link: http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
What about using
rand()
for radius and angle and not discarding any? :)I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
that results in an entirely different distribution, as now the cartesian density is higher near the center. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.
-
that results in an entirely different distribution, as now the cartesian density is higher near the center. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.
Yep. http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
Yep. http://mathworld.wolfram.com/DiskPointPicking.html[^]
-- Time you enjoy wasting is not wasted time - Bertrand Russel
darts players would like it though, they'd hit bull's eye much oftener[*]. :laugh: [*] trying to keep it a loungy thread.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.
-
What about using
rand()
for radius and angle and not discarding any? :)I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
Because it is plainly wrong. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Yes, I thought about that a bit, but it felt as it would skew the density and give a wrong bias to the points with x/y values inside the circle. I cannot put words on that feeling, so it's probably plain wrong.
-- Time you enjoy wasting is not wasted time - Bertrand Russel
I don't see the problem, namely: Assumed that
X
andY
are independent coordinates.rand()
gives (pseudo)random numbers with uniform distribution.
extracting
N
numbers (withN
big enough) will fill uniformly a square area. Finally cutting a circle from this area, gives you the requested uniformly populated circular area. Of course this is going on my arrogant assumptions... :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I don't see the problem, namely: Assumed that
X
andY
are independent coordinates.rand()
gives (pseudo)random numbers with uniform distribution.
extracting
N
numbers (withN
big enough) will fill uniformly a square area. Finally cutting a circle from this area, gives you the requested uniformly populated circular area. Of course this is going on my arrogant assumptions... :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Maybe you're right - who am I to say? After all, I only have this "feeling" which makes me feel like my wife; she's full of them. Anyway, I'm following http://mathworld.wolfram.com/DiskPointPicking.html[^] now.
-- Time you enjoy wasting is not wasted time - Bertrand Russel
-
Well, it is winter - it makes sense to use polar coordinates :-D
Well, you need to see the question from the right angle... :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Maybe you're right - who am I to say? After all, I only have this "feeling" which makes me feel like my wife; she's full of them. Anyway, I'm following http://mathworld.wolfram.com/DiskPointPicking.html[^] now.
-- Time you enjoy wasting is not wasted time - Bertrand Russel
That way you haven't to discard anything (that would make me feel like my wife... :rolleyes: ). I'm curious about performance, though: you may try both methods, compare them (for correctness and performance) and eventually write an article... :laugh:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]