Example usage for org.apache.commons.math.analysis UnivariateRealSolver solve

List of usage examples for org.apache.commons.math.analysis UnivariateRealSolver solve

Introduction

In this page you can find the example usage for org.apache.commons.math.analysis UnivariateRealSolver solve.

Prototype

double solve(double min, double max, double startValue)
        throws ConvergenceException, FunctionEvaluationException;

Source Link

Document

Solve for a zero in the given interval, start at startValue.

Usage

From source file:org.jcurl.model.ComputedPaths.java

static double firstHit(final R1RnCurve a, final R1RnCurve b, double tmin, double tmax)
        throws FunctionEvaluationException {
    final DistanceSq dist = new DistanceSq(a, b);
    final UnivariateRealSolver solver = new NewtonSolver(dist);
    try {/*from   w  ww.  jav  a  2s.  c  om*/
        return solver.solve(tmin, tmax, tmin + 1e-2);
    } catch (ConvergenceException e) {
        return Never;
    }
}