*/
package eu.svjatoslav.sixth.e3d.geometry;
+import static java.lang.Math.abs;
+import static java.lang.Math.min;
+
+/**
+ * Rectangle class.
+ */
public class Rectangle {
public Point2D p1, p2;
}
public double getHeight() {
- return Math.abs(p1.y - p2.y);
+ return abs(p1.y - p2.y);
}
public double getLowerX() {
- if (p1.x < p2.x)
- return p1.x;
- return p2.x;
+ return min(p1.x, p2.x);
}
public double getLowerY() {
- if (p1.y < p2.y)
- return p1.y;
- return p2.y;
+ return min(p1.y, p2.y);
}
public double getWidth() {
- return Math.abs(p1.x - p2.x);
+ return abs(p1.x - p2.x);
}
}
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+/**
+ * Used to represent transformation in a 3D space.
+ * Transformations are represented as a translation and an orientation.
+ */
public class Transform implements Cloneable {
private final Point3D translation;