comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java @ 514:d9d933e06875

Fixed gnv/issue153 gnv-artifacts/trunk@608 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 22 Jan 2010 18:22:11 +0000
parents 70adafe2b9d5
children 4e347624ee7c
comparison
equal deleted inserted replaced
513:ca5048e4e515 514:d9d933e06875
70 StandardDeviation sd = new StandardDeviation(); 70 StandardDeviation sd = new StandardDeviation();
71 71
72 for (ArrayList<Point2d> v: jMap.values()) { 72 for (ArrayList<Point2d> v: jMap.values()) {
73 Collections.sort(v, Point2d.Y_COMPARATOR); 73 Collections.sort(v, Point2d.Y_COMPARATOR);
74 for (int i = 1, L = v.size(); i < L; ++i) { 74 for (int i = 1, L = v.size(); i < L; ++i) {
75 double dy = Math.abs(v.get(i).y - v.get(i-1).y); 75 // double dy = Math.abs(v.get(i).y - v.get(i-1).y);
76 double dy = v.get(i).distance(v.get(i-1));
76 deltas.add(dy); 77 deltas.add(dy);
77 mean.increment(dy); 78 mean.increment(dy);
78 sd .increment(dy); 79 sd .increment(dy);
79 } 80 }
80 } 81 }
102 sd .clear(); 103 sd .clear();
103 104
104 for (ArrayList<Point2d> v: iMap.values()) { 105 for (ArrayList<Point2d> v: iMap.values()) {
105 Collections.sort(v, Point2d.X_COMPARATOR); 106 Collections.sort(v, Point2d.X_COMPARATOR);
106 for (int i = 1, L = v.size(); i < L; ++i) { 107 for (int i = 1, L = v.size(); i < L; ++i) {
107 double dx = Math.abs(v.get(i).x - v.get(i-1).x); 108 //double dx = Math.abs(v.get(i).x - v.get(i-1).x);
109 double dx = v.get(i).distance(v.get(i-1));
108 deltas.add(dx); 110 deltas.add(dx);
109 mean.increment(dx); 111 mean.increment(dx);
110 sd .increment(dx); 112 sd .increment(dx);
111 } 113 }
112 } 114 }

http://dive4elements.wald.intevation.org