gpt4 book ai didi

algorithm - 球体上密度最高的位置

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:45:01 25 4
gpt4 key购买 nike

我在球体表面有很多点。如何计算具有最大点密度的球体的面积/点?我需要非常快地完成这项工作。例如,如果这是一个正方形,我想我可以创建一个网格,然后让这些点投票决定网格的哪一部分是最好的。我曾尝试将这些点转换为球坐标,然后制作网格,但这两种方法都效果不佳,因为北极周围的点在球体上很近,但在转换后很远。

谢谢

最佳答案

实际上没有真正的理由将球体划分为规则的非重叠网格,试试这个:

enter image description here

数学实现

分析 5000 个点需要 12 秒。 (写了大约 10 分钟)

 testcircles = { RandomReal[ {0, 1}, {3}] // Normalize};
Do[While[ (test = RandomReal[ {-1, 1}, {3}] // Normalize ;
Select[testcircles , #.test > .9 & , 1] ) == {} ];
AppendTo[testcircles, test];, {2000}];
vmax = testcircles[[First@
Ordering[-Table[
Count[ (testcircles[[i]].#) & /@ points , x_ /; x > .98 ] ,
{i, Length[testcircles]}], 1]]];

enter image description here

关于algorithm - 球体上密度最高的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24658889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com