Modulo:Coord: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
provo a fare la correzione al massimo rollbacko
m Annullate le modifiche di Dega180 (discussione), riportata alla versione precedente di Rotpunkt
Riga 230:
 
-- Ritorna un nuovo oggetto DmsCoord, convertendo in gradi/minuti/secondi
function DecCoord:toDms(dmsFormat)
local dec, deg, min, sec, card
 
carddec = self.carddeg
if self.deg <= 0 thenmath.floor(dec)
dec = (dec min =- deg) %* 60
card = card == "N" and "S" or (card == "E" and "W" or card)
degmin = math.floor((deg - sec) / 60dec)
end
dec = (dec - min) = deg %* 60
self.deg = self.deg >= 0 and self.deg or -self.deg
degsec = round(self.deg * 3600dec, 2)
 
if dmsFormat == "d" then
return DmsCoord:new(deg, min, sec, deg = round(self.deg, 0card)
elseif dmsFormat == "dm" then
deg = round(self.deg * 60, 0)
min = deg % 60
deg = math.floor((deg - min) / 60)
elseif dmsFormat == "dms" then
deg = round(self.deg * 3600, 2)
sec = deg % 60
deg = math.floor((deg - sec) / 60)
min = deg % 60
deg = math.floor((deg - min) / 60) % 360
end
return DmsCoord:new(deg, min, sec, card)
end