/// <summary>
        /// Calculate 3D d(C_L)/d(alpha) of a MirroredLiftDevice type
        /// </summary>
        /// <param name="ld">MirroredLiftDevice to evaluate</param>
        /// <param name="F">Fuselage lift factor</param>
        /// <param name="B">sqrt(1-M^2)</param>
        /// <param name="nu">Efficiency factor</param>
        /// <returns></returns>
        private static float CalculateC_aLMLD(MirroredLiftDevice ld, float F, float B, float nu)
        {
            // Assume quarter chord is max thickness
            var sweep = ld.CalculateSweep(0.25f) * Mathf.Deg2Rad;

            //var S_exp_ratio = 2.1f;
            return(F * (2 * Mathf.PI * ld.AspectRatio) / (2 + Mathf.Sqrt(4 + Mathf.Pow(ld.AspectRatio * B / nu, 2) * (1 + Mathf.Pow(Mathf.Tan(sweep / B), 2)))));
        }
        private static float CalculateM_CR(MirroredLiftDevice ld, float C_L)
        {
            var hsweep    = ld.CalculateSweep(0.5f) * Mathf.Deg2Rad;
            var coshsweep = Mathf.Cos(hsweep);

            var M_DD = (Constants.Metrics.KornFactor - (ld.ThicknessChordRatio / coshsweep) - (C_L) / (10 * Mathf.Pow(coshsweep, 2))) / coshsweep;

            return(M_DD - 0.108f);
        }
        public static float CalculateRe(float velocity, float altitude, MirroredLiftDevice ld)
        {
            var cBar = CalculateMeanAerodynamicChord(ld);

            // Kinematic viscoscity - interpolated from international standard atmosphere with 3rd order polynomial
            var nu = CalculateKinematicViscosity(altitude);

            return(velocity * (ld.CalculateMeanAerodynamicChord() / 2) * Constants.m2ft / nu);
        }
        /// <summary>
        /// Returns X position of the aerodynamic centre of a MirroredLiftDevice type
        /// </summary>
        /// <param name="ld">MirroredLiftDevice to evaluate</param>
        /// <returns>Decimetres</returns>
        public static float AerodynamicCentre(this MirroredLiftDevice ld)
        {
            var lambda = ld.Sweep * Mathf.Deg2Rad;
            var cBar   = CalculateMeanAerodynamicChord(ld);
            var YBar   = (ld.Span / 6) * ((1 + 2 * lambda) / (1 + lambda));

            var centre = Mathf.Tan(lambda) * YBar + 0.25f * cBar;

            return(centre + ld.GetXPosition());
        }
        /// <summary>
        /// Calculate C_D0 for MirroredLiftDevice types
        /// </summary>
        /// <param name="ld"></param>
        /// <param name="S_ref"></param>
        /// <param name="Re"></param>
        /// <param name="C_f"></param>
        /// <returns></returns>
        private static float CalculateMLDC_D0(MirroredLiftDevice ld, float S_ref, float Re, float C_f)
        {
            // Calculate form factor
            var gamma_quarter = ld.CalculateSweep(0.25f) * Mathf.Deg2Rad;
            var S_wet         = ld.Area / 100f;

            var xc = 0.25f;
            var tc = ld.ThicknessChordRatio;
            var FF = (1 + (0.6f / xc * tc) + 100 * Mathf.Pow(tc, 4)) * (1.34f * Mathf.Pow(Constants.Metrics.DesignMachNumber, 0.18f) * Mathf.Pow(Mathf.Cos(gamma_quarter), 0.28f));

            var Q = 1.1f;       // Engines I guess

            return((C_f * FF * Q * S_wet) / S_ref);
        }
        /// <summary>
        /// Returns the mean aerodynamic chord of a MirroredLiftDevice type
        /// </summary>
        /// <param name="ld">MirroredLiftDevice type to evaluate</param>
        /// <returns>Metres</returns>
        public static float CalculateMeanAerodynamicChord(this MirroredLiftDevice ld)
        {
            var lambda = ld.Sweep * Mathf.Deg2Rad;

            return((0.066667f) * ld.RootChord * (1 + lambda + Mathf.Pow(lambda, 2)) / (1 + lambda));
        }
 /// <summary>
 /// Calculate C_L maximum for a MirroredLiftDevice type
 /// </summary>
 /// <param name="ld">MirroredLiftDevice type to evaluate</param>
 /// <param name="C_L_max_2d">2D C_L_Max. 1.6 for NACA2412 Airfoil</param>
 /// <returns></returns>
 private static float CalculateC_LMax(this MirroredLiftDevice ld, float C_L_max_2d = 1.6f)
 {
     // C_L_Max of NACA 2412 = 1.6
     return(0.9f * C_L_max_2d * Mathf.Cos(ld.CalculateSweep(0.25f) * Mathf.Deg2Rad));
 }