2 * Sixth 3D engine. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
9 package eu.svjatoslav.sixth.e3d.geometry;
11 public class Rectangle {
13 public Point2D p1, p2;
15 public Rectangle(final double size) {
16 p2 = new Point2D(size / 2, size / 2);
17 p1 = p2.clone().invert();
20 public Rectangle(final Point2D p1, final Point2D p2) {
25 public double getHeight() {
26 return Math.abs(p1.y - p2.y);
29 public double getLowerX() {
35 public double getLowerY() {
41 public double getWidth() {
42 return Math.abs(p1.x - p2.x);