Content deleted Content added
DRY for params |
refactor EN to LL conversion |
||
Line 53:
local dr = math.deg(1.0)
local scaleGB = 0.9996012717▼
local eastingGB = 400000.0▼
local northingGB = -100000.0▼
Line 80 ⟶ 74:
semimajor = 6377563.396,
semiminor = 6356256.910,
ecc = 0.006670539761597529073698869358812557054558,
lat0 = 49.0,
lon0 = -2.0
}
Line 243:
end
local function
local
local lat0rad = deg2rad(datum.lat0)
local
▲ local auk= OSGBglobe.semimajor*F0uk
▲ local n1uk=0.00167322025032508731869331280635710896296
local e2uk=OSGBglobe.ecc▼
local nextcounter=0
local j3, j4, j5, j6, m
repeat
nextcounter=nextcounter+1
local k3=k-
local k4=k+
j3=(1.0+
j4=(3.0*
j5=(1.875*pow(
j6=35.0/24.0*pow(
m=
k=k+(n-
until abs(n-
local v=
local r=v*(1.0-
local h2=v/r-1.0
local y1=e-
j3=tan(k)/(2.0*r*v)
j4=tan(k)/(24.0*r*pow(v,3.0))*(5.0+3.0*pow(tan(k),2.0)+h2-9.0*pow(tan(k),2.0)*h2)
Line 289 ⟶ 274:
local j9=1.0/(cos(k)*5040.0*pow(v,7.0))
local j9=j9*(61.0+662.0*pow(tan(k),2.0)+1320.0*pow(tan(k),4.0)+720.0*pow(tan(k),6.0))
local long=
local lat=rad2deg(k9
return {lat=lat,lon=long}
local helmert = HelmertDatumShift ( lat, long, OSGB2WGSparam)▼
end
local function GBEN2LL(e,n)
return {region="GB",lat=helmert.lat,long=helmert.lon}
end
|