Post by bluatigro on Aug 20, 2018 12:18:49 GMT
this is far from complete
feel free to extend
feel free to extend
''dimension unit
''distance m
''time s
''mass Kg
''force N = Kg * m / s ^ 2
''enegy J = N * m
''power W = J / s
''pressure p = N / m ^ 2
''frequenty Hz = 1 / s
''symbol : E P T G M K c m u n p f a
'' 1e.. : 18 15 12 9 6 3 -2 -3 -6 -9 -12 -18 -24
''============================ lenght
print lj2Gm( 1 ) ; " Gm"
end
''lightyear - Gm
function lj2Gm( lj )
lj2Pm = lj * 300 * 60 * 60 * 24 * 365.25 / 1e9
end function
function miles2Km( miles )
miles2km = miles * 1.609344
end function
function yard2m( yard )
yard2m = yard * .9144
end function
function feet2m( feet )
feet2m = feet * .3048
end function
function inch2cm( inch )
inch2cm = inch * 2.54
end function
''============================== area
function acre22m2( acre2 )
acre22m2 = acre2 * 4046.8564
end function
function yard22m2( yard2 )
yard22m2 = yard2 * .83612736
end function
function feet22m2( feet2 )
feet22m2 = feet2 * .09290304
end function
function inch22cm2( inch2 )
inch22cm2 = inch2 * 645.16
end function
''============================= volume
'' L = 0.001 m3
function barrel2L( barrel )''oil
barrel2L = barrel * 158.9873
end function
function feet32L( feet3 )
feet32L = feet3 * 28.31685
end function
function gallonUS2L( gus )
gallonUS2L = gus * 4.546092
end function
function gallonGB2L( ggb )
gallonGB2L = ggb * 3.785
end function
function inch32cm3( inch3 )
inch32cm3 = inch3 * 16.39
end function
function yard32m3( yard3 )
yard32m3 = yard3 * .7645844
end function
''us fluid onnces
function oz2mL( oz )
oz2mL = oz * 29.57
end function
''======================== mass
''short ton - kg
function st2kg( st )
st2kg = st * 907.1847
end function
''short hunderd weight
function shw2kg( swh )
shw2kg = swh * 45.35924
end function
function ounce2g( ounce )
ounce2g = ounce * 28.349529
end function
function grain2mg( grain )
grain2mg = grain * 64.79891
end function
''========================= speed
function miles2Kmph( mph )
miles2Kmph = mph * 1.609344
end function
function knots2mps( knots )
knots2mps = knots * .51444
end function
function feet2mps( feetps )
feet2mps = feetps * .3048
end function
''======================= presure
''ponds / feet ^ 2 - pascal
function psf2p( psf )
psf2p = psf * 47.88026
end function
''Hg m - k pascal
function Hgm2Kp( Hgm )
Hgm2p = Hgm * 133.32239
end function
''ponds / inch ^ 2 - k pascal
function ppinch22kp( p )
ppinch22kp = p * 6.8944757
end function
''====================== energy
''calory - joule
function cal2j( cal )
cal2j = cal * 4.184
end function
''british terminal unit - joule
function btu2j( btu )
btu2j = btu * 1054.35
end function
''house power hour - M joule
function hp2j( hp )
hp2j = hp * 2.68452
end function
''=================== power
''btu / hour - k watt
function btuph2KW( b )
btuph2KW = b * .292875
end function
''K calory - watt
function Kcal2W( Kcal )
Kcal2W = Kcal * 1.163
end function
''horse power - watt
function hp2W( hp )
hp2W = hp * 745.7
end function
''============================= misc
''fahrenheit - celsius
function f2c( f )
f2c = ( f - 32 ) * 5 / 9
end function
''celsius - kelvin
function c2k( c )
c2k = c + 273.15
end function
''foot candle - lux
function lux( fc )
lux = fc * 10.76391
end function
''foot lamberts - candela / m2
function canela( fl )
candela = fl * 3.4262591
end function