我的应用中有很多用户,所有用户都有固定的位置点 我想创建一个新的部分,用户可以在其中看到附近的其他用户,就像Messenger Wichet和Bitalk一样 我如何将这些地方进行比较?
答案 0 :(得分:0)
找出两个位置之间的距离,并将其与您的近距离标准进行比较。
import numpy as np
from matplotlib.pyplot import step, show
data = [ [1, 2, 4, 5, 9, 12, 13, 14],
[1, 4, 10, 11, 20, 21, 22],
[1, 2, 3, 4, 15, 16, 17, 18] ]
# find out the longest data to plot
limit = max( [ x[-1] + 1 for x in data] )
x = np.arange(0, limit)
for shift, d in enumerate(data):
y = np.zeros_like(x)
y[d] = 1
# don't forget to shift
y += 2*shift
step(x, y)
show()
我不知道,也许PHP已经有了一些库。如果没有,两点之间的距离可以通过Vincenty公式计算。您可以使用谷歌的实施示例,也可以在Android SDK的Function picRng() As Range
Set picRng = ActiveSheet.Range("A1:Z1000")
Set rngfindvalue = picRng.Find(what:="http", Lookat:=xlPart)
If Not rngfindvalue Is Nothing Then
rngFirstAddress = rngfindvalue.Address
Do
MsgBox rngfindvalue.Address
Set rngfindvalue = picRng.FindNext(rngfindvalue)
Loop Until rngfindvalue Is Nothing Or rngfindvalue.Address = rngFirstAddress
End If
End Function
方法中查看。
因为它是一个迭代算法,所以减少计算次数会很好。例如,您可以基于两个纬度整数值之间的距离为110 km以及经度110 * cos(纬度)的两个整数值之间的距离将粗糙滤波器应用于其他位置。
祝你好运!