MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getFirst

Method getFirst

src/test/Derivative.java:51–53  ·  view source on GitHub ↗

Direct application of first derivative method. @param f @param x @param h @return

(final DoubleUnaryOperator f, double x, double h)

Source from the content-addressed store, hash-verified

49 * @return
50 */
51 static public double getFirst(final DoubleUnaryOperator f, double x, double h) {
52 return (f.applyAsDouble(x + h) - f.applyAsDouble(x - h)) / h / 2.0;
53 }
54
55 /**
56 * First derivative wrapped to re-assign one of the two parameters.

Callers 1

unwrappedFIMethod · 0.95

Calls 1

applyAsDoubleMethod · 0.80

Tested by

no test coverage detected