You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param function A function that takes in an x value and outputs a {@code y} value.
16
+
* @param lowerBoundary The lower boundary for integration, conventionally the {@code a} value.
17
+
* @param upperBoundary The upper boundary for integration, conventionally the {@code b} value.
18
+
* @param accuracy The accuracy of the integration. It is recommended to keep this less than 10. Each sub-interval will have a width of {@code 10^(-accuracy)}.
19
+
* @return The approximate value of the definite integral, calculated using the left Riemann Sum.
@@ -19,7 +26,13 @@ public double leftRiemannSum(final Function<Double, Double> function, final doub
19
26
}
20
27
returnvalue;
21
28
}
22
-
29
+
/**
30
+
* @param function A function that takes in an x value and outputs a {@code y} value.
31
+
* @param lowerBoundary The lower boundary for integration, conventionally the {@code a} value.
32
+
* @param upperBoundary The upper boundary for integration, conventionally the {@code b} value.
33
+
* @param accuracy The accuracy of the integration. It is recommended to keep this less than 10. Each sub-interval will have a width of {@code 10^(-accuracy)}.
34
+
* @return The approximate value of the definite integral, calculated using the right Riemann Sum.
@@ -30,7 +43,13 @@ public double rightRiemannSum(final Function<Double, Double> function, final dou
30
43
}
31
44
returnvalue;
32
45
}
33
-
46
+
/**
47
+
* @param function A function that takes in an x value and outputs a {@code y} value.
48
+
* @param lowerBoundary The lower boundary for integration, conventionally the {@code a} value.
49
+
* @param upperBoundary The upper boundary for integration, conventionally the {@code b} value.
50
+
* @param accuracy The accuracy of the integration. It is recommended to keep this less than 10. Each sub-interval will have a width of {@code 10^(-accuracy)}.
51
+
* @return The approximate value of the definite integral, calculated using the midpoint Riemann Sum.
@@ -40,6 +59,13 @@ public double midpointRiemannSum(final Function<Double, Double> function, final
40
59
returnvalue;
41
60
}
42
61
62
+
/**
63
+
* @param function A function that takes in an x value and outputs a {@code y} value.
64
+
* @param lowerBoundary The lower boundary for integration, conventionally the {@code a} value.
65
+
* @param upperBoundary The upper boundary for integration, conventionally the {@code b} value.
66
+
* @param accuracy The accuracy of the integration. It is recommended to keep this less than 10. Each sub-interval will have a width of {@code 10^(-accuracy)}.
67
+
* @return The approximate value of the definite integral, calculated using the trapezoidal Riemann Sum.
0 commit comments