예제 #1
0
파일: GlidePolar.cpp 프로젝트: DRIZO/xcsoar
fixed
GlidePolar::GetBestGlideRatioSpeed(fixed head_wind) const
{
  assert(polar.IsValid());

  fixed s = sqr(head_wind) +
    (mc + polar.c + polar.b * head_wind) / polar.a;
  if (negative(s))
    /* should never happen, but just in case */
    return GetVMax();

  return head_wind + sqrt(s);
}
예제 #2
0
double
GlidePolar::GetBestGlideRatioSpeed(double head_wind) const
{
  assert(polar.IsValid());

  auto s = head_wind * head_wind +
    (mc + polar.c + polar.b * head_wind) / polar.a;
  if (s < 0)
    /* should never happen, but just in case */
    return GetVMax();

  return head_wind + sqrt(s);
}