programming-examples/asp/FilesMaths/Nautical-Flight Functions.asp

51 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
'miles per hour to knots
Private Function MPHToKt(ByVal mph)
MPHToKt = CDbl(CDbl(mph) / 1.152)
End Function
'knots to miles per hour
Private Function KtToMPH(ByVal kt)
KtToMPH = CDbl(1.152 * CDbl(Kt))
End Function
'miles to nautical miles
Private Function miToNautMi(ByVal miles)
MiToNautMi = CDbl((CDbl(miles) * 5280) / 6076.1)
End Function
'nautical miles to miles
Private Function nautMiToMi(ByVal nautMi)
NautMiToMi = CDbl((CDbl(nautMi) * 6076.1) / 5280)
End Function
'flight time in minutes
Private Function minsInFlight(ByVal nautMi, ByVal kt)
MinsInFlight = CDbl((CDbl(nautMi) / CDbl(kt)) * 60)
End Function
'nautical miles flown
Private Function nautMiFlown(ByVal kt, ByVal mins)
NautMiFlown = (CDbl(mins) / 60) * CDbl(CDbl(kt))
End Function
'average speed in knots
Private Function ktSpeed(ByVal nautMi, ByVal mins)
ktSpeed = CDbl(CDbl(nautMi) / (CDbl(mins) / 60))
End Function
'hours to minutes
Private Function hrMins(ByVal hr)
hrMins = CDbl(CDbl(hr) * 60)
End Function
'seconds to minutes
Private Function sdMins(ByVal sd)
sdMins = CDbl(CDbl(sd) / 60)
End Function
'gallons of fuel needed
Private Function galFuel(ByVal mins, ByVal gph)
galFuel = CDbl((CDbl(mins) / 60) * gph)
End Function