MathUtils/Polynomial.cs
/// <summary>
/// Finds the root of a first order polynomial f(x) = A*x + B.
/// If A is equal to zero the root will be empty.
/// </summary>
/// <param name="a">The linear coefficent A.</param>
/// <param name="b">The constant offset B.</param>
/// <returns>An array containing the root or nothing.</returns>
Finds the root of a first order polynomial f(x) = A*x + B.
If A is equal to zero the root will be empty.
Finds the root of a first order polynomial f ( x ) = A * x + B . If A is equal to zero the root will be empty .
public static double[] LinearRootD(double a, double b)
        {
            if(a == 0)
            {
                return new double[0];
            }
            else
            {
                return LinearRootD(b / a);
            }
        }
public static double [ ] LinearRootD ( double a , double b ) { if ( a == 0 ) { return new double [ 0 ] ; } else { return LinearRootD ( b / a ) ; } }
Finds the root of a first order polynomial f(x) = A*x + B.
Finds the root of a first order polynomial f ( x ) = A * x + B .
An array containing the root or nothing.
An array containing the root or nothing .
a
double
The linear coefficent A.
The linear coefficent A .
b
double
The constant offset B.
The constant offset B .