##E6B1v2.0 ##Den? ##01 // Calculate density altitude disp("Compute Density Altitude") P_Alt=in("Pressure Altitude?") T=in("Air temp in C?") // Correct for std temp at pressure altitude T_s= 15-.0019812*P_Alt // We use the simplified density altitude calc D_alt=P_Alt+118.6*(T-T_s) // Now round off D_alt=round(D_alt) out("Density Altitude:",D_alt) ##TAS? ##02 // Compute true airspeed disp("Compute True Airspeed ") Ias=in("Indicated Airspeed?") P_Alt=in("Pressure Altitude?") T=in("Air temp in C?") // Correct for std temp at pressure altitude T_s= 15-.0019812*P_Alt // We use the simplified D_Alt calculation D_Alt=P_Alt+118.6*(T-T_s) Tas=Ias/(1-6.8755856e-6 * D_Alt)^2.127940 Tas=round(Tas) out("True Airspeed:",Tas) end(1) ##Wnd? ##03 // Unknown wind clv(1) tm(0) disp("Find Unknown Wind") Tas=in("True airspeed?") Hdg=in("Heading?") Gs=in("Ground speed?") Trk=in("Track/Course?") Ws=4*Tas*Gs*(sin((Hdg-Trk)/2))^2 Ws=sqrt((Tas-Gs)^2+ Ws) round(Ws) wait("Wind speed; R/S to continue") y=Tas*sin(Hdg-Trk) x=Tas*cos(Hdg-Trk)-Gs Wd=Trk+atan2(y,x) Wd=Wd+360 Wd=fmod(Wd,360) Wd=round(Wd) out("Wind direction",Wd) end(1) ##Xwd? ##04 :start disp("Compute Cross Wind/Drift") WS=in("Windspeed in kts?") WD=in("Wind dir in Degrees?") menu=ask("Runway","Drift") jmpif(menu,"Runway","Drift") :Runway RH=in("Runway Heading?") hw=WS*fabs(cos(WD-RH)) xw=WS*sin(WD-RH) round(xw) wait("XWind, R/S to continue") hw=round(hw) wait("Headwind") jmp("start") :Drift TAS=in("True airspeed?") CRS=in("Course?") WC=(WS/TAS)*sin(WD-CRS) HD=CRS+asin(SWC) GS=sqrt(WS^2 + TAS^2 - 2*WS*TAS*cos(HD-WD)) HD=HD+iff(HD<0,360,0) round(HD) wait("Heading, R/S to continue") round(GS) wait("Ground Speed:") end(1) ##Tmp? ##05 disp("Convert Temps ") menu=ask("F to C","C to F") jmpif(menu,"FC","CF") :FC F=in("Temp in F?") C=round((F-32)/.18)/10 disp("Converted temp in C is") end(1) :CF C=in("Temp in C?") F=round((C*1.8+32)*10)/10 disp("Converted temp in F is") end(1) : General Comments : One of 2 aviation program goups (E6B1 and E6B2) based on E6B by John Bell who : based much of his work on the work ... : "Aviation Formulary V1.43" by Ed Williams. : Please refer to http://williams.best.vwh.net/avform.htm : Some of John's work is retained here, but I just made it more : applicable to folks like me who do not fly heavy iron, : as in single engine Cessna drivers. : E6B mimics the basic E6B functions whereas NAV contains some : basic navigation functions. : I am Bruce Stafford, DO, find me at docstafford@cox.net, : especially with suggestions or bug fixes. If you hack this further : do it without cost to the benefit of all pilots. : : There are some basic simplifications in this group of calculations - : 1. compressibility is ignored - my cessna 172 just won't go that fast! : 2. we don't use mach numbers here (see 1. above) : 3. altitudes are assumed to be less than about 36,000 ft : 4. CAS is assumed to be IAS : 5. miles are in knots : 6. Temp calculations do nut use the K recovery factor