style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@@ -7,9 +7,9 @@ public class SimpsonIntegration {
/*
* Calculate definite integrals by using Composite Simpson's rule.
* Wiki: https://en.wikipedia.org/wiki/Simpson%27s_rule#Composite_Simpson's_rule
* Given f a function and an even number N of intervals that divide the integration interval e.g. [a, b],
* we calculate the step h = (b-a)/N and create a table that contains all the x points of
* the real axis xi = x0 + i*h and the value f(xi) that corresponds to these xi.
* Given f a function and an even number N of intervals that divide the integration interval
* e.g. [a, b], we calculate the step h = (b-a)/N and create a table that contains all the x
* points of the real axis xi = x0 + i*h and the value f(xi) that corresponds to these xi.
*
* To evaluate the integral i use the formula below:
* I = h/3 * {f(x0) + 4*f(x1) + 2*f(x2) + 4*f(x3) + ... + 2*f(xN-2) + 4*f(xN-1) + f(xN)}
@@ -25,9 +25,7 @@ public class SimpsonIntegration {
// Check so that N is even
if (N % 2 != 0) {
System.out.println(
"N must be even number for Simpsons method. Aborted"
);
System.out.println("N must be even number for Simpsons method. Aborted");
System.exit(1);
}