示例#1
0
static bool
test_find_qnh()
{
  AtmosphericPressure pres;
  pres.FindQNH(fixed(100), fixed(100));
  return fabs(pres.get_QNH()-fixed(1013.25))<fixed(0.01);
}
示例#2
0
static bool
test_qnh_round()
{
  AtmosphericPressure pres;
  pres.FindQNH(fixed(100), fixed(120));
  fixed h0 = pres.AltitudeToQNHAltitude(fixed(100));
  if (verbose) {
    printf("%g\n",FIXED_DOUBLE(h0));
  }
  return fabs(h0-fixed(120))<fixed(1);
}
示例#3
0
static bool
test_qnh_round2()
{
  AtmosphericPressure pres;
  pres.FindQNH(fixed(100), fixed(120));
  fixed p0 = pres.get_QNH()*100;
  fixed h0 = pres.StaticPressureToQNHAltitude(p0);
  if (verbose) {
    printf("%g %g\n",FIXED_DOUBLE(p0),FIXED_DOUBLE(h0));
  }
  return fabs(h0)<fixed(1);
}
示例#4
0
static bool
test_find_qnh2()
{
  AtmosphericPressure pres;
  pres.FindQNH(fixed(100), fixed(120));
  if (verbose) {
    printf("%g\n",FIXED_DOUBLE(pres.get_QNH()));
  }
  return fabs(pres.get_QNH()-fixed(1015.6))<fixed(0.1);
  // example, QNH=1014, ps=100203
  // alt= 100
  // alt_known = 120
  // qnh= 1016
}