changeset 6949:13c2762270a6

issue1462: 1) & 4) Fix wrong density interpolation code.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 30 Aug 2013 09:48:11 +0200
parents d4108d6c4000
children 40da4a6e2cfb
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java	Fri Aug 30 09:47:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java	Fri Aug 30 09:48:11 2013 +0200
@@ -129,9 +129,8 @@
         double upperDensity = next.getDensity();
         double lowerDensity = prev.getDensity();
 
-        double m =(upperDensity - lowerDensity)/(upper - lower) * km;
-        double b = lowerDensity -
-            ((upperDensity - lowerDensity)/(upper - lower) * lower);
+        double m =(upperDensity - lowerDensity)/(upper - lower);
+        double b = lowerDensity - (m * lower);
         return (m * km) + b;
     }
 

http://dive4elements.wald.intevation.org