对单位球面均匀随机(蒙特卡洛)分布球面、均匀、蒙特、卡洛

由网友(软妹小仙女)分享简介:我需要的算法生成随机值,我的宠物光线追踪澄清。我发出的光线从一个点。我与这些光线的分布问题:我需要的分布是均匀的,但它不是... I need a clarification with algorithm generating random values for my pet ray-tracer.I emit...

我需要的算法生成随机值,我的宠物光线追踪澄清。 我发出的光线从一个点。我与这些光线的分布问题:我需要的分布是均匀的,但它不是...

I need a clarification with algorithm generating random values for my pet ray-tracer. 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...

我现在面临的问题是分布为均匀最初不是我的成绩的空间扭曲后,均匀。

The problem I face now is that the distribution being uniform initially is not uniform after my distortions of the space of results.

因此​​,例如,我生成R和T的角度,如果极坐标系。的分布是不均匀的,它不能是均匀的:空间接近每个极都有效果比,比方说,接近赤道的多密度。原因是pretty的清楚:我转换成均匀分布的点,从圆柱形空间球形。我扭曲的结果。同样的问题是,如果我在正常化立方体随机生成点。

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.

我现在的想法是这样的:我想创建一个四面体,规范其顶点,分裂每个面(三角形)的点在中间,将它规范化和递归地重复,直到我有足够的积分。然后,我扭曲这些点一点点。然后,我又归他们。而已。

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.

据我所知,这种方法不是纯粹的数学蒙特卡罗方法本身,因为我不使用随机分布,除了在最后一个的任何步骤。而且我不喜欢这个解决方案的这种复杂性。

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.

任何人都可以提出什么更简单,但仍

Can anyone suggest anything more simple yet still

随机 统一 快速 简单

谢谢!

编辑: 我需要一个快速的方法,不只是一个正确。这就是为什么我问蒙特卡洛。提供的答案是正确的,但并不快。与四面体的方法是快速的,但不是很随机=>不正确。 我真正需要的东西更合适。

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. I really need something more suitable.

推荐答案

这里的的一种算法,可以让你产生点随机分布在单位球面上。

Here's an algorithm that allows you to generate points randomly distributed on the unit sphere.

阅读全文

相关推荐

最新文章