Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
oops
no atan2
Line 538:
local e2 = ( aq - b2 * b2 ) / aq
 
lambda = atan2atan ( y2 , x2 )
 
local p2 = sqrt ( x2*x2 + y2*y2 )
phi = atan2atan ( z2 , p2*(1.-e2) )
 
limit = 1. / b2
Line 549:
local phi_alt = phi
ny = a2 / sqrt ( 1. - e2 * sin(phi) * sin(phi) )
phi = atan2atan ( z2 + e2 * ny * sin(phi) , p2 )
n0 = no - 1
until abs ( phi - phi_alt ) <= limit or n0 <= 0