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:
Paul Schaller 2023-12-21 19:54:25 +01:00
parent e7f1aa9b3c
commit 010882aef2
2 changed files with 8 additions and 6 deletions

View File

@ -54,6 +54,8 @@ public class PointNormalizer {
normalizedX = normalizedX * 2.0 - 1.0;
normalizedY = 1.0 - normalizedY;
double xyRatio = (biggestYValue - smallestYValue) / (biggestXValue - smallestXValue);
normalizedY = normalizedY * xyRatio;
normalizedPoints[i] = new Point2D.Double(normalizedX, normalizedY);
}

View File

@ -75,9 +75,9 @@ public class ExampleTest {
foundYMax = true;
}
if(Math.abs(points[i].z - (1.0)) < 0.001) {
/*if(Math.abs(points[i].z - (1.0)) < 0.001) {
foundZMax = true;
}
}*/
if(Math.abs(points[i].z - (0.0)) < 0.001) {
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);
}else {
System.out.println(foundXMin );
@ -162,9 +162,9 @@ public class ExampleTest {
foundYMax = true;
}
if(Math.abs(points[i].z - (1.0)) < 0.001) {
/*if(Math.abs(points[i].z - (1.0)) < 0.001) {
foundZMax = true;
}
}*/
if(Math.abs(points[i].z - (0.0)) < 0.001) {
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);
}else {
System.out.println(foundXMin );