Module:User:Mr rnddude/Sandbox: Difference between revisions
Appearance
Content deleted Content added
Mr rnddude (talk | contribs) Hang on, if the rate of pressure reduces at higher altitudes then 1/27 is faster than 1/30 |
Mr rnddude (talk | contribs) Up to 2500 feet. |
||
Line 22: | Line 22: | ||
P = P - 1 |
P = P - 1 |
||
output = output .. "<br />" .. MSL .. ", " .. P |
output = output .. "<br />" .. MSL .. ", " .. P |
||
until (MSL > |
until (MSL > 2500 or P < 0) |
||
return output |
return output |
||
end |
end |
Revision as of 16:13, 19 April 2017
-- This is my module sandbox.
-- Simple repetition module.
-- At Sea level on an ISA day,
-- the pressure should be 1013.2 hPa.
-- I've reduced this to 1013 hPa. Up to
-- 5,000 feet the pressure reduces by 1
-- hPa per 27 feet. Beyond 5,000 feet
-- the rate of reduction decreases. Off
-- the top of my head I can't remember
-- what it is (1/30ft?), but, whatever.
P = 1014 -- hPa
Incr = 27 -- feet
MSL = -27 -- feet
local p = {}
function p.Altitude (frame)
output = "Altitude (Feet), Pressure (hPa)"
repeat
MSL = MSL + Incr
P = P - 1
output = output .. "<br />" .. MSL .. ", " .. P
until (MSL > 2500 or P < 0)
return output
end
return p