projects
/
debian
/
openrocket
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixed of-by-one bug in trapz integrator
[debian/openrocket]
/
core
/
src
/
net
/
sf
/
openrocket
/
util
/
ArrayUtils.java
diff --git
a/core/src/net/sf/openrocket/util/ArrayUtils.java
b/core/src/net/sf/openrocket/util/ArrayUtils.java
index 8f0db53081f6ac14609ab9343e005fe2de66c309..7d373096a3cae4930e878b4f47de9521f0137628 100644
(file)
--- a/
core/src/net/sf/openrocket/util/ArrayUtils.java
+++ b/
core/src/net/sf/openrocket/util/ArrayUtils.java
@@
-95,7
+95,7
@@
public class ArrayUtils {
* dt is the time step between each array value
*/
public static double trapz(double[] y, double dt){
- double stop =
y.length
* dt;
+ double stop =
(y.length -1)
* dt;
if (y.length <= 1 || dt <= 0) return 0;