I'm working on displaying a sphere made with uniform, independent, random points with C++ and I do not know how to distribute the points in 3-D. Is there a way I can do this in C++?
Asked
Active
Viewed 43 times
0
-
This is more of a general algorithmic question, not specific to c++. Also, random, independent and uniform are not necessarily compatible, depending on your definition of each. Can you clarify your problem statement, and also what you're actually having issues with? – tmpearce Apr 25 '17 at 01:34
-
I think you can do it by selecting 2 random angles 0-360 degrees but I can't prove it - I could be wrong. – Mark Ransom Apr 25 '17 at 01:35
-
Are you asking how to generate random numbers, or how to select the random numbers from within a range, or how to distribute those points in 3D, or something else? Also, what have you tried so far? – Vada Poché Apr 25 '17 at 01:36
-
@MarkRansom You'd want (360°x180°), otherwise you hit every point twice. However, you must choose proper distributions depending on the parametrization, in the standard parametrization, uniform distribution won't work. – Baum mit Augen Apr 25 '17 at 01:48