2 * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public License
6 * or later as published by the Free Software Foundation.
11 package eu.svjatoslav.sixth.e3d.geometry;
13 public class Rectangle {
15 public Point2D p1, p2;
17 public Rectangle(final double size) {
18 p2 = new Point2D(size / 2, size / 2);
19 p1 = p2.clone().invert();
22 public Rectangle(final Point2D p1, final Point2D p2) {
27 public double getHeight() {
28 return Math.abs(p1.y - p2.y);
31 public double getLowerX() {
37 public double getLowerY() {
43 public double getWidth() {
44 return Math.abs(p1.x - p2.x);