Plane crazy utilizes a variety of complicated formulas to simulate drag coefficients and other values to simulate an airfoil, i have tried this before and unless you have a good grasp on the aerodynamics concepts already, it is extremely difficult, That said there are a couple of topics regarding this and i will send you some links as soon as i find them.
Also, if you don’t want to reinvent the wheel, here is a script with the basic functionality:
If yo do want to reinvent the wheel however, here is a link to a bunch of stuff regarding the topic: