Need an algorithm to pixelate an n-dimensional hypersphere

你。 提交于 2020-01-02 17:15:24

问题


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

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.


回答1:


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.

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).



来源:https://stackoverflow.com/questions/3613190/need-an-algorithm-to-pixelate-an-n-dimensional-hypersphere

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!