窗口:
Install minGw充分选择。 更改环境变量:系统变化途径,包括
c:mingwin
测试功能指挥:
g++ --version
复制文档:延伸功能,c, sqlite3.h, sqlite3ext.h, qlite3 ProgramDirectory。 编写和汇编:
gcc -shared -I "path" -o libsqlitefunctions.so extension-functions.c
(path = qlite3ext.h;即C:sqlite3)
如果该方案得以建立,允许装备延期,则以下工作将:
sqlite> SELECT load_extension( ./libsqlitefunctions.so );
sqlite> select cos(radians(45));
0.707106781186548
SQLite 远程办公 implementation:
From: https://www.movable-type.co.uk/scripts/latlong.html https://en.wikipedia.org/wiki/甲型六氯环己烷_formula
远程办公
This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).
甲型六氯环己烷
办法:
a = sin²(Δφ/2) + cos φ1 * cos φ2 * sin²(Δλ/2)
c = 2 * atan2( √a, √(1−a) )
c = 2 *
d = R * c
φ为纬度,λ为长度,R为地球rad(mean radius = 6,371km);
请注意,需要从摩擦中去除三边功能!
Java:
const R = 6378136.6 ; // meters equatorial radius
const φ1 = lat1 * Math.PI/180; // φ, λ in radians
const φ2 = lat2 * Math.PI/180;
const Δφ = (lat2-lat1) * Math.PI/180;
const Δλ = (lon2-lon1) * Math.PI/180;
const a = Math.sin(Δφ/2) * Math.sin(Δφ/2) +
Math.cos(φ1) * Math.cos(φ2) *
Math.sin(Δλ/2) * Math.sin(Δλ/2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
const c = 2 * Math.asen(MIN (1, Math.sqrt(a))); //sqlite implementation
const d = R * c; // in metres
远程办公 = 2 * R * ASIN( MIN (1, SQRT( SIN( (RADIANS(lat1)-RADIANS(lat2))/2 )^2 + COS( RADIANS(lat1) )*COS( RADIANS(lat2) )*SIN( (RADIANS(long1)-RADIANS(long2))/2 )^2 )))
地球物理特性https://en.wikipedia.org/wiki/ Earth_ellipsvil:Ecuatorial radius: 6378.1366 Kms。 平均rad:6367 Kms
Constant = 2 * 6378136.6 = 12756273.2
4. 从下表中找到坐标的弹道:
ROUND (
12756273.2 * ASIN(
MIN (1 ,
SQRT(
POWER( SIN(RADIANS(PAR.Lat1 - PAR.Lat2)/2) , 2) +
COS(RADIANS(PAR.Lat1)) * COS(RADIANS(PAR.Lat2)) * POWER ( SIN(RADIANS(PAR.Long1 - PAR.Long2)/2) , 2)
)
)
)
, 0) AS 远程办公