void VLiftCoeff (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*30.0;
static const double istep = 1.0/step;
static const int nabsc = 13;
// Angle of attack -180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180
static const double CL[nabsc] = { 0, -0.12, -0.1, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.12, 0};
static const double CM[nabsc] = { 0, -0.0002,-0.0004, -0.0004,-0.0003,-0.0002, 0, 0.0002, 0.0003, 0.0004, 0.0004,0.0002, 0};
// lift and moment coefficients from -180 to 180 in 30 degree steps.
aoa += PI;
int idx = max (0, min (11, (int)(aoa*istep)));
double d = aoa*istep - idx;
*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
*cm = ( CM[idx] + (CM[idx+1]-CM[idx])*d ) / 10;
*cd = 0.25 + oapiGetInducedDrag (*cl, 1.27, 0.3);
}
// 2. horizontal lift component (vertical stabiliser and body)
void HLiftCoeff (double beta, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*30;
static const double istep = 1.0/step;
static const int nabsc = 13;
static const double CL[nabsc] = { 0, -0.1, -0.1, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.1, 0};
beta += PI;
int idx = max (0, min (11, (int)(beta*istep)));
double d = beta*istep - idx;
*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
*cm = 0.0;
*cd = 0.25 + oapiGetInducedDrag (*cl, 1.27, 0.3);
}