Fixed of-by-one bug in trapz integrator
authorrichardgraham <richardgraham@180e2498-e6e9-4542-8430-84ac67f01cd8>
Fri, 17 Aug 2012 07:09:51 +0000 (07:09 +0000)
committerrichardgraham <richardgraham@180e2498-e6e9-4542-8430-84ac67f01cd8>
Fri, 17 Aug 2012 07:09:51 +0000 (07:09 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@973 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/util/ArrayUtils.java

index 8f0db53081f6ac14609ab9343e005fe2de66c309..7d373096a3cae4930e878b4f47de9521f0137628 100644 (file)
@@ -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;