Monday, July 2, 2007

Winds Aloft algorithm for computing True Airspeed

This algorithm should produce an adjusted airspeed taking into account
Winds Aloft speed and angle. It is somewhat "pseudo-code" due to
limitations with capitalization on my Sidekick as I type this on an
airplane. Total time to derive and code 1hr, 15minutes.

-shannon norrell
////////////////////////////////////////////////////
Tas=400; //True airspeed
Was=50; //Winds aloft speed
Waa=10; //Winds aloft angle (plug various vals here to test)
Adj=0; //Covers cases of Waa==90 and Waa=270

Switch(true) {
Case((Waa==0) || (Waa==360)):
Adj=-Was;
Break;
Case(Waa==180):
Adj=+Was;
Break;
Case((Waa>0)&&(Waa<90)):
Adj=-((90-Waa))\90)*Was;
Break;
Case((Waa>90)&&(Waa<180)):
Adj=((Waa-90)\90)*Was;
Break;
Case((Waa>180)&&(Waa<270)):
Adj=(1-((Waa-180)/90))*Was;
Break;
Case((Waa>270)&&(Waa<360)):
Adj=-((Waa-270)\90)*Was;
Break;
}
Aas=Tas+Adj; //Adjusted airspeed
--webdood