org.sunflow.math
Class Solvers
public final class Solvers
extends java.lang.Object
static double[] | solveQuadric(double a, double b, double c)- Solves the equation ax^2+bx+c=0.
|
static double[] | solveQuartic(double a, double b, double c, double d, double e)- Solve a quartic equation of the form ax^4+bx^3+cx^2+cx^1+d=0.
|
solveQuadric
public static final double[] solveQuadric(double a,
double b,
double c) Solves the equation ax^2+bx+c=0. Solutions are returned in a sorted array
if they exist.
a - coefficient of x^2b - coefficient of x^1c - coefficient of x^0
- an array containing the two real roots, or
null if
no real solutions exist
solveQuartic
public static double[] solveQuartic(double a,
double b,
double c,
double d,
double e) Solve a quartic equation of the form ax^4+bx^3+cx^2+cx^1+d=0. The roots
are returned in a sorted array of doubles in increasing order.
a - coefficient of x^4b - coefficient of x^3c - coefficient of x^2d - coefficient of x^1e - coefficient of x^0
- a sorted array of roots, or
null if no solutions
exist