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); }
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); }