Модуль:Бәәрн Бәәлһн Һазрин Зург: хүвлвр хоорндк йилһән

Аһулһнь уга кегдлә Аһулһнь немгдлә
Ясврин тәәлвр уга
Ясврин тәәлвр уга
81-гч мөр:
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
end
elseifif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
end
elseifif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
end
elseifif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
Мөр 93 ⟶ 96:
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
end
if minutes then
if not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
end
if not multiplierdegrees then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
end
end
if seconds then
if not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
if not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
end
end
if not degreeshemisphere then
error('TheA hemisphere "'was .. hemisphere .. '"not provided for ' .. direction .. ' is not valid', 2)
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
end
if hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
Мөр 112 ⟶ 120:
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if not tonumber(minutes) then
local multiplier = hemisphereMultipliers[direction][hemisphere]
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
if not multiplier then
end
error('AThe hemisphere was"' .. hemisphere .. '" provided for ' .. direction .. ' withoutis degreesnot also being providedvalid', 2)
if not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
decimal = decimal * multiplier
return decimal
end