public final class Solver extends Object
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
static double |
firstSolutionAfter(double lowerBound,
double a,
double b,
double c)
Solve a quadratic or linear equation and return the solution that is closest (but not less than) a boundary.
|
static double[] |
solve(double a,
double b)
Solve linear equation ax+b=0 for x.
|
static double[] |
solve(double a,
double b,
double c)
Solve quadratic equation ax2+bx+c=0 for x.
|
public static double[] solve(double a, double b, double c)
a
- double; the coefficient of x2b
- double; the coefficient of xc
- double;public static double firstSolutionAfter(double lowerBound, double a, double b, double c) throws ValueException
lowerBound
- double; minimum value of good solutiona
- double; quadratic coefficientb
- double; linear coefficientc
- double; value of the quadratic function for x==0ValueException
- if there is no acceptable solutionpublic static double[] solve(double a, double b)
a
- double; the coefficient of xb
- double;Copyright © 2014–2018 Delft University of Technology. All rights reserved.