Propably fixed a semantic issue which was caused by communication
problems: the height of the tree can be bigger than 1.0
This commit is contained in:
parent
e7f1aa9b3c
commit
010882aef2
@ -54,6 +54,8 @@ public class PointNormalizer {
|
|||||||
normalizedX = normalizedX * 2.0 - 1.0;
|
normalizedX = normalizedX * 2.0 - 1.0;
|
||||||
|
|
||||||
normalizedY = 1.0 - normalizedY;
|
normalizedY = 1.0 - normalizedY;
|
||||||
|
double xyRatio = (biggestYValue - smallestYValue) / (biggestXValue - smallestXValue);
|
||||||
|
normalizedY = normalizedY * xyRatio;
|
||||||
|
|
||||||
normalizedPoints[i] = new Point2D.Double(normalizedX, normalizedY);
|
normalizedPoints[i] = new Point2D.Double(normalizedX, normalizedY);
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ public class ExampleTest {
|
|||||||
foundYMax = true;
|
foundYMax = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Math.abs(points[i].z - (1.0)) < 0.001) {
|
/*if(Math.abs(points[i].z - (1.0)) < 0.001) {
|
||||||
foundZMax = true;
|
foundZMax = true;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(Math.abs(points[i].z - (0.0)) < 0.001) {
|
if(Math.abs(points[i].z - (0.0)) < 0.001) {
|
||||||
foundZMin = true;
|
foundZMin = true;
|
||||||
@ -85,7 +85,7 @@ public class ExampleTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(foundXMin && foundXMax && foundYMin && foundYMax && foundZMin && foundZMax) {
|
if(foundXMin && foundXMax && foundYMin && foundYMax && foundZMin /*&& foundZMax*/) {
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
}else {
|
}else {
|
||||||
System.out.println(foundXMin );
|
System.out.println(foundXMin );
|
||||||
@ -162,9 +162,9 @@ public class ExampleTest {
|
|||||||
foundYMax = true;
|
foundYMax = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Math.abs(points[i].z - (1.0)) < 0.001) {
|
/*if(Math.abs(points[i].z - (1.0)) < 0.001) {
|
||||||
foundZMax = true;
|
foundZMax = true;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(Math.abs(points[i].z - (0.0)) < 0.001) {
|
if(Math.abs(points[i].z - (0.0)) < 0.001) {
|
||||||
foundZMin = true;
|
foundZMin = true;
|
||||||
@ -172,7 +172,7 @@ public class ExampleTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(foundXMin && foundXMax && foundYMin && foundYMax && foundZMin && foundZMax) {
|
if(foundXMin && foundXMax && foundYMin && foundYMax && foundZMin /*&& foundZMax*/) {
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
}else {
|
}else {
|
||||||
System.out.println(foundXMin );
|
System.out.println(foundXMin );
|
||||||
|
Loading…
Reference in New Issue
Block a user