Note that there are some explanatory texts on larger screens.

plurals
  1. POUniform random (Monte-Carlo) distribution on unit sphere
    primarykey
    data
    text
    <p>I need a clarification with algorithm generating random values for my pet ray-tracer.<br> I emit rays from one point. And I have the problem with distribution of these rays: I need the distribution to be uniform, but it isn't... </p> <p>The problem I face now is that the distribution being uniform initially is not uniform after my distortions of the space of results. </p> <p>So for example, I generate r and t angles if the polar coordinate system. The distribution is not uniform and it cannot be uniform: space close to each pole has much more density of results than, say, close to equator. The reason is pretty clear: I convert uniformly distributed points from cylindrical space to the spherical. And I distort results. The same problem is if I normalize points generated randomly in the cube. </p> <p>My idea now is this: I want to create a tetrahedron, normalize its vertexes, split each face (triangle) with the point in the middle, normalize it and repeat recursively until I have enough points. Then I "distort" these points a little bit. Then I normalize them again. That's it. </p> <p>I understand that this method is not pure mathematical Monte-Carlo method itself, because I do not use random distribution in any step except for the last one. And I do not like this solution for this complexity. </p> <p>Can anyone suggest anything more simple yet still </p> <ul> <li>random</li> <li>uniform</li> <li>fast</li> <li>simple</li> </ul> <p>Thanks!</p> <p><strong>EDIT:</strong><br> I need a fast method, not just the correct one. That's why I'm asking about Monte-Carlo. Answers provided are correct, but not fast. The method with tetrahedron is fast, but not very "random" => incorrect.<br> I really need something more suitable.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload