Accord.Math.svd.Pythag C# (CSharp) Method

Pythag() private static method

private static Pythag ( double a, double b ) : double
a double
b double
return double
        private static double Pythag(double a, double b)
        {
            double at = System.Math.Abs(a), bt = System.Math.Abs(b), ct, result;

            if (at > bt)
            {
                ct = bt / at;
                result = at * System.Math.Sqrt(1.0 + ct * ct);
            }
            else if (bt > 0.0)
            {
                ct = at / bt;
                result = bt * System.Math.Sqrt(1.0 + ct * ct);
            }
            else
            {
                result = 0.0;
            }

            return result;
        }
    }