Content deleted Content added
Andy M. Wang (talk | contribs) again |
Andy M. Wang (talk | contribs) checking again |
||
Line 8:
function p.speed_of_sound(frame)
local altitude = tonumber(frame.args[1]) -- args[0] is speed_of_sound
local mach_table = { --
799.5, 787.0, 774.2, 761.207051, -- -3 to 0
748.0, 734.6, 721.0, 707.0, 692.8, 678.3, 663.5, 660.1, 660.1, 660.1, -- 1 to 10
Line 18:
}
altitude = altitude or 0
-- ensure it is within range [-3..60]
return mach_table[a + 4] * 0.44704 .. ' | ' .. a .. ' | ' .. sign .. ' | ' .. altitude -- mph converted to m/s▼
scale = math.max(-3, math.min(60,
math.floor((altitude / 5000) + ((altitude < 0) and -0.5 or 0.5))))
▲ return mach_table[
end
|