主題
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)。


另請參閱

球三角形拾取, 圓點拾取, 盤點拾取, 大圓, 超球面點拾取, 噪聲球, 球線拾取, 球四面體拾取, 湯姆遜問題

使用 探索

參考文獻

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." math-fun@cs.arizona.edu 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.

在 中被引用

球面點拾取

引用為

Weisstein, Eric W. “球面點拾取。” 來自 Web 資源。 https://mathworld.tw/SpherePointPicking.html

主題分類