Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
refactor EN to LL conversion
fix missing params
Line 587:
local T = pow( tan(lat_rad), 2)
local C = e_prime_sq * pow( cos(lat_rad), 2)
local A = deg2rad( longitude2 -lon0GBOSGBglobe.lon0 ) * cos(lat_rad)
local M = find_M( lat_rad )
local M0 = 0.0
if latitude_origin ~= 0 then
M0 = find_M(deg2rad( lat0GBOSGBglobe.lat0 ))
end
 
local northing = northingGBOSGBglobe.n0 + scaleGBOSGBglobe.scale *
( (M - M0) + v*tan(lat_rad) *
( A*A/2
Line 601:
+ 600*C - 330*e_prime_sq) * pow(A,6)/720 ))
 
local easting = eastingGBOSGBglobe.e0 + scaleGBOSGBglobe.scale * v *
( A
+ (1-T+C)*pow(A,3)/6