需要一种算法来像素化的n维超球算法、像素、维超球

2023-09-11 05:09:23 作者:煞尾

我想斌向量在n维空间。这可以通过pixelating n维超球面的表面来完成。

I would like to bin vectors in n-dimensional space. This can be done by pixelating the surface of an n-dimensional hypersphere.

有谁知道什么好的算法pixelating C语言的超球?我想不断的块大小。我的空间仅由正整数。

Does anyone know any good algorithms for pixelating a hypersphere in C? I would like constant bin sizes. My space consists of only positive integers.

推荐答案

你需要你的垃圾箱是完全正常吗?如果没有,只是扔指出,在随机的,并测量距离最近的邻居。您可以通过扔掉过于接近点,或运行相互排斥的几次迭代稍微打扫一下。

Do you need your bins to be perfectly regular? If not, just throw points out at random, and measure distance to the nearest neighbor. You could clean this up slightly by throwing away points that are too close, or running a few iterations of mutual repulsion.

否则,你可能要转换为广义球面坐标和仓进入沿着每个相等的区域尺寸。特别是,如果你知道你在20上经度斌5,你的纬度箱将宽于他们将在赤道(约开方(2)的角度更广泛,事实上,对应于同样的距离的面)。

Otherwise, you probably want to convert to generalized spherical coordinates and bin into equal areas along each dimension. In particular, if you know you're in bin 5 of 20 on longitude, your latitude bins will be wider than they would be at the equator (about sqrt(2) wider in angle, in fact, to correspond to the same distance on the surface).