##E6B2v2.0 ##Hdg? ##06 // Compute Hdg and Gs tm(0) disp("Compute Hdg/Gs") Crs=in("True course in deg?") Crs=Crs+360 Var=in("Variation in deg?") menu=ask("East","West") jmpif(menu,"East","West") :East Crs=Crs-Var jmp("around") :West Crs=Crs+Var :around Crs=fmod(Crs,360) out("Magnetic Course",Crs) W_dir=in("Wind direction?") W_spd=in("Wind speed in kts?") Tas=in("True air speed in kts?") Swc=(W_spd/Tas)*sin(W_dir-Crs) iff(fabs(Swc) >1,"nogo") jmp("continue") :nogo disp("Wind too strong to fly") end(1) :continue Hdg=Crs+asin(Swc) Hdg=round(Hdg) Hdg=fmod(Hdg,360) iff(Hdg>0,"do_speed") Hdg=Hdg+360 :do_speed Gs=Tas*sqrt(1-Swc^2)-W_spd*cos(W_dir-Crs) iff(Gs<0,"nogo") Hdg wait(" Heading; R/S to continue") Gs=round(Gs) out("Ground speed",Gs) end(1) ##Vsp? ##07 // Descent Vspd to target altitude disp("Compute descent Vspd") :begin Alt=in("Indicated Altitude?") Tpa=in("Target Altitude?") iff(Tpa>Alt,"begin") Loss=Alt-Tpa Gs=in("Ground speed in kts?") Dist=in("Distance to target in km?") Prof=(Loss*Gs)/(Dist*60) disp("Descent profile ft/min:") round(Prof) end(1) ##Des? ##08 //Compute when to begin descent at fixed Vspd disp("Compute descent profile") :begin Alt=in("Start altitude?") Tpa=in("Target altitude?") iff(Tpa>Alt,"begin") Loss=Alt-Tpa Vspd=in("Desired descent speed in fpm?") // Assume Vspd is negative Gs=in("Ground speed in kts?") Dist=in("Distance to target in km?") Gs_min=Gs/60 // Compute time to lose altitude Loss_tm=Loss/Vspd // Compute time to target at this speed T_tgt=Dist/Gs_min iff(T_tgt",hms) end(1) ##Dst? ##11 // Great Circle Nav disp(" ") // Most of John Bell's code is unalterd here menu=ask("new","add") jmpif(menu,"new","add") :new tdist=0 format=ask("ddmm.dd","dd.ddddd") lat1? lon1? lat2? lon2? jmpif(format,"dmn","ddn") :add lat1=lat2 lon1=lon2 lat2? lon2? jmpif(format,"dmn2","ddn") :dmn lat1=lat1/100 lon1=lon1/100 lat1=trunc(lat1)+(lat1-trunc(lat1))/.6 lon1=trunc(lon1)+(lon1-trunc(lon1))/.6 :dmn2 lon2=lon2/100 lat2=lat2/100 lat2=trunc(lat2)+(lat2-trunc(lat2))/.6 lon2=trunc(lon2)+(lon2-trunc(lon2))/.6 :ddn d=cos(lat1)*cos(lat2) d=d*cos(lon2-lon1) d=acos(d+sin(lat1)*sin(lat2)) ldist=60*d x=sin(lat2)-sin(lat1)*cos(d) TCRS=acos((x)/(sin(d)*cos(lat1))) iff(sin(lon1-lon2)<0,"output") TCRS=360-TCRS :output round(TCRS) wait("True course, R/S to continue") round(ldist*10)/10 wait("Dist in nm. R/S to continue") tdist=ldist+tdist round(tdist*10)/10 wait("Total Dist nm. R/S to continue") jmp("add") : Second of two APCalc load based on John Bell's original E6B : See comments in E6B1 source