00001 package delaunaypackage; 00002 /* 00003 * Rectangle class. Need rectangles for window to viewport mapping. 00004 */ 00005 class RealRectangle { 00006 RealPoint ll; 00007 RealPoint ur; 00008 00009 RealRectangle() { } 00010 00011 RealRectangle (RealRectangle r) { 00012 this.ll = new RealPoint(r.ll); 00013 this.ur = new RealPoint(r.ur); 00014 } 00015 00016 RealRectangle (RealPoint ll, RealPoint ur) { 00017 this.ll = new RealPoint(ll); 00018 this.ur = new RealPoint(ur); 00019 } 00020 00021 RealRectangle(float xMin, float yMin, float xMax, float yMax) { 00022 this.ll = new RealPoint(xMin, yMin); 00023 this.ur = new RealPoint(xMax, yMax); 00024 } 00025 00026 public float width() { return ur.x() - ll.x(); } 00027 public float height() { return ur.y() - ll.y(); } 00028 00029 public RealPoint ll() { return ll; } 00030 public RealPoint ur() { return ur; } 00031 00032 public float xMin() { return ll.x; } 00033 public float yMin() { return ll.y; } 00034 00035 public float xMax() { return ur.x; } 00036 public float yMax() { return ur.y; } 00037 }
1.5.5