Class Pegasus
java.lang.Object
org.shredzone.commons.suncalc.util.Pegasus
Finds the root of a function by using the Pegasus method.
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Pegasus
public Pegasus()
-
-
Method Details
-
calculate
public static Double calculate(double lower, double upper, double accuracy, Function<Double, Double> f) Find the root of the given function within the boundaries.- Parameters:
lower
- Lower boundaryupper
- Upper boundaryaccuracy
- Desired accuracyf
- Function to be used for calculation- Returns:
- root that was found
- Throws:
ArithmeticException
- if the root could not be found in the given accuracy within 30 iterations.
-