主题
Search

球面点拾取


SphericalDistribution

要在单位球面的表面上选取一个随机点,选择来自均匀分布theta in [0,2pi)phi in [0,pi]球面坐标 thetaphi 是不正确的,因为面积元素 dOmega=sinphidthetadphiphi 的函数,因此以这种方式选取的点将“聚集”在极点附近(如上左图所示)。

可以使用 Wolfram 语言中的函数在单位球面上拾取 n 个随机点:RandomPoint[Sphere[], n].

为了获得这样的点,使得球面上任何小区域预期包含相同数量的点(如上右图所示),选择 UV 作为 (0,1) 上的随机变量。然后

theta=2piu
(1)
phi=cos^(-1)(2v-1)
(2)

给出了均匀分布在 S^2 上的点集的球面坐标。这之所以有效,是因为立体角的微分元素由下式给出

 dOmega=sinphidthetadphi=-dthetad(cosphi).
(3)

极角的分布 P_phi 可以从下式找到

 P_phidphi=P_v|(dv)/(dphi)|dphi,
(4)

通过对 v 求 (2) 的导数得到 dphi/dv,解 (2) 得到 v,并将结果代入 (4) 并令 P_v=1,得到分布

 P_phi=1/2sinphi.
(5)
SpherePointPickingUTheta

类似地,我们可以选择 u=cosphi 均匀分布(因此我们有 du=sinphidphi),并获得点

x=sqrt(1-u^2)costheta
(6)
y=sqrt(1-u^2)sintheta
(7)
z=u,
(8)

其中 theta in [0,2pi)u in [-1,1],这些点也均匀分布在 S^2 上。

SpherePointPickingMarsaglia

Marsaglia (1972) 推导出一个优雅的方法,该方法包括从 (-1,1) 上的独立均匀分布中选取 x_1x_2,并拒绝满足 x_1^2+x_2^2>=1 的点。从剩余的点中,

x=2x_1sqrt(1-x_1^2-x_2^2)
(9)
y=2x_2sqrt(1-x_1^2-x_2^2)
(10)
z=1-2(x_1^2+x_2^2)
(11)

单位球面的表面上具有均匀分布。此方法也可以扩展到超球面点拾取。上面的图显示了 100、1000 和 5000 个初始点的分布(其中计数指的是丢弃之前的点数)。

SpherePointPickingCook

Cook (1957) 扩展了 von Neumann (1951) 的方法,给出了一个在单位球面的表面上均匀分布地拾取点的简单方法。从 (-1,1) 上的均匀分布中选取四个数字 x_0x_1x_2x_3,并拒绝满足以下条件的点对

 x_0^2+x_1^2+x_2^2+x_3^2>=1.
(12)

从剩余的点中,四元数变换规则表明,具有笛卡尔坐标的点

x=(2(x_1x_3+x_0x_2))/(x_0^2+x_1^2+x_2^2+x_3^2)
(13)
y=(2(x_2x_3-x_0x_1))/(x_0^2+x_1^2+x_2^2+x_3^2)
(14)
z=(x_0^2+x_3^2-x_1^2-x_2^2)/(x_0^2+x_1^2+x_2^2+x_3^2)
(15)

具有所需的分布 (Cook 1957, Marsaglia 1972)。上面的图显示了 100、1000 和 5000 个初始点的分布(其中计数指的是丢弃之前的点数)。

拾取球面上随机点的另一种简单方法是生成三个高斯随机变量 xyz。然后,向量的分布

 1/(sqrt(x^2+y^2+z^2))[x; y; z]
(16)

在表面 S^2 上是均匀的 (Muller 1959, Marsaglia 1972)。


另请参阅

球三角形拾取, 圆点拾取, 盘点拾取, 大圆, 超球面点拾取, 噪声球, 球线拾取, 球四面体拾取, 汤姆逊问题

使用 Wolfram|Alpha 探索

参考文献

Cook, J. M. "Technical Notes and Short Papers: Rational Formulae for the Production of a Spherically Symmetric Probability Distribution." Math. Tables Aids Comput. 11, 81-82, 1957.Feller, W. An Introduction to Probability Theory and Its Applications, Vol. 2, 3rd ed. New York: Wiley, 1971.Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, pp. 130-131, 1998.Marsaglia, G. "Choosing a Point from the Surface of a Sphere." Ann. Math. Stat. 43, 645-646, 1972.Muller, M. E. "A Note on a Method for Generating Points Uniformly on N-Dimensional Spheres." Comm. Assoc. Comput. Mach. 2, 19-20, Apr. 1959.Rusin, D. "N-Dim Spherical Random Number Drawing." In The Mathematical Atlas. http://www.math.niu.edu/~rusin/known-math/96/sph.rand.Salamin, G. "Re: Random Points on a Sphere." [email protected] posting, May 5, 1997.Stephens, M. A. "The Testing of Unit Vectors for Randomness." J. Amer. Stat. Assoc. 59, 160-167, 1964.von Neumann, J. "Various Techniques Used in Connection with Random Digits." NBS Appl. Math. Ser., No. 12. Washington, DC: U.S. Government Printing Office, pp. 36-38, 1951.Watson, G. S. and Williams, E. J. "On the Construction of Significance Tests on the Circle and Sphere." Biometrika 43, 344-352, 1956.

在 Wolfram|Alpha 中被引用

球面点拾取

引用为

Weisstein, Eric W. “球面点拾取。” 来自 MathWorld--Wolfram Web 资源。 https://mathworld.net.cn/SpherePointPicking.html

主题分类