C# Class Artemis.Engine.Maths.RootSolver

Mostrar archivo Open project: ArtemisEngine/Artemis-Engine

Public Methods

Method Description
Cubic ( double A, double B, double C, double D ) : double[]

Solve for the real roots of a cubic. (Ax^3 + Bx^2 + Cx + D == 0)

NewtonsMethod ( double>.Func f, double>.Func df, double value, double initialGuess, double epsilon = 1e-9, int maxIterations = 1000 ) : double

Use the Newton-Raphson method to attempt to approximate the root of a function. In particular, this function takes in three parameters, f, df, and v. f and df are the function and its derivative respectively. This method then returns x such that f(x) = v (i.e. the root of f(x) - v = 0).

Quadratic ( double A, double B, double C ) : double[]

Solve for the real roots of a quadratic. (Ax^2 + Bx + C == 0)

Method Details

Cubic() public static method

Solve for the real roots of a cubic. (Ax^3 + Bx^2 + Cx + D == 0)
public static Cubic ( double A, double B, double C, double D ) : double[]
A double
B double
C double
D double
return double[]

NewtonsMethod() public static method

Use the Newton-Raphson method to attempt to approximate the root of a function. In particular, this function takes in three parameters, f, df, and v. f and df are the function and its derivative respectively. This method then returns x such that f(x) = v (i.e. the root of f(x) - v = 0).
public static NewtonsMethod ( double>.Func f, double>.Func df, double value, double initialGuess, double epsilon = 1e-9, int maxIterations = 1000 ) : double
f double>.Func
df double>.Func
value double
initialGuess double
epsilon double
maxIterations int
return double

Quadratic() public static method

Solve for the real roots of a quadratic. (Ax^2 + Bx + C == 0)
public static Quadratic ( double A, double B, double C ) : double[]
A double
B double
C double
return double[]