Modulo:Sandbox/M.casanova/DatiMappa: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica
mNessun oggetto della modifica
Riga 24:
end
end
local dx = 0.95*(bmx - bmn)
local dy = 0.95*(amx - amn)
-- if (dimx>dimy) then dx = dx*dimy/dimx else dy = dy*dimx/dimy end
local scalascalax, = 10scalay
if (dx == 0) scalathen scalax = 18 else scalax = math.floor(math.log(360180/dx)/math.log(2)) end
if (dx == 0) then
if (dy == 0) then scalay = 18 else scalay = math.floor(math.log(180/dy)/math.log(2)) end
if (dy == 0) then
local scala
-- default
if ((dx == 0) and (dy == 0)) then
else
scala = math.floor(math.log(180/dy)/math.log(2))10
endelse
scala = math.max(0,math.min(18,scalax, scalay))
else
elseend
if (dy == 0) then
scala = math.floor(math.log(360/dx)/math.log(2))
else
scala = math.min( math.floor(math.log(360/dx)/math.log(2)), math.floor(math.log(180/dy)/math.log(2)) )
end
end
if (scala < 0) then scala = 0 end
if (scala > 17) then scala = 18 end
return scala
end