Модуль:Бәәрн Бәәлһн Һазрин Зург: хүвлвр хоорндк йилһән
Аһулһнь уга кегдлә Аһулһнь немгдлә
Ясврин тәәлвр уга |
Ясврин тәәлвр уга |
||
81-гч мөр:
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
end▼
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
end▼
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
end▼
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▼
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)▼
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)▼
end
end
if 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
▲ if minutes then
▲ error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
▲ end
▲ end
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
▲ error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
if not multiplier then
▲ end
▲
▲ 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
▲ 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
return decimal
end
|