给定lat/long中的现有点,(以KM表示)和方位(以度数转换为弧度)的距离,我想计算新的纬度/经度.这个网站反复出现,但我无法让这个公式为我工作.
采用上述链接的公式为:
lat2 = asin(sin(lat1)*cos(d/R) + cos(lat1)*sin(d/R)*cos(?))
lon2 = lon1 + atan2(sin(?)*sin(d/R)*cos(lat1), cos(d/R)?sin(lat1)*sin(lat2))
Run Code Online (Sandbox Code Playgroud)
上述公式适用于MSExcel,其中 -
asin = arc sin()
d = distance (in any unit)
R = Radius of the earth (in the same unit as above)
and hence d/r = is the angular distance (in radians)
atan2(a,b) = arc tan(b/a)
? is the bearing (in radians, clockwise from north);
Run Code Online (Sandbox Code Playgroud)
这是我在Python中获得的代码.
import math
R = 6378.1 #Radius of the Earth
brng = 1.57 #Bearing is 90 degrees converted …Run Code Online (Sandbox Code Playgroud) 我将使用FOpen,FRead,FWrite,FSeek和FClose为Netburner嵌入式设备(非Windows)实现自定义VFS(虚拟文件系统).我很惊讶我找不到可用的VFS的FOpen*版本.这将使嵌入式设备的便携性更高.
我在http://sqlite.org/c3ref/vfs.html上找到了有关为SQLite创建VFS的一些信息, 但信息非常详细,我还有很多关于实现的问题.
我在Winite,OS2,Linux的SQLite源代码中有一些示例VFS,但它们没有很多注释,只有源代码.
我可以使用上面链接中提供的信息和示例来创建我的自定义VFS,但我确信如果我这样做,我会错过一些东西.
我的问题是:
我想在嵌入式应用程序中运行 sqlite。能够运行 sqlite 来维护数据库的最低要求是什么?我正在考虑实现 R*tree 进行空间搜索。如果我能得到证明这些要求合理的解释,那将会很有帮助。
具有大约 32kb 内存的 Cortex M0/Cortex M3 是否足够?我需要多少闪存?
我正在考虑将数据库本身存储在 SD 卡上。
我有一组不同大小的一维数组,例如:
P1 [] = {0,2,5,6,9,8,7,55,7,4,1}
P2 [] = {11,22,55,5,8,7,4,65,87,7,88,9,8,77,4,5,6,33,2,1,44,5,8,55}
P3 [] = {0}
//...
//...
Pn [] = { "","","","",...."",""}
Run Code Online (Sandbox Code Playgroud)
我想这些阵列依次传递给一个函数,说-
功能(Pi),在那里我从变化1到n.
我怎样才能做到这一点?
所有1D阵列在运行时之前都是已知的.内存需要进行优化,因此使用2d阵列的效率会低于预期.