package xmp_parent;

public class Rectangle extends Shape {
	double width;
	double height;
	
	public Rectangle(Point llc, double width, double height) {
		super(llc);
		this.width = width;
		this.height = height;
	}
	public void grow(double factor) { width*=factor; height*=factor; }
	Point getul() { Point ul=new Point(getllc()); ul=ul.move(0,height); return ul; }
	Point getlr() { Point lr=new Point(getllc()); lr=lr.move(width,0); return lr; }
	public Point getur() { Point ur = new Point(getllc()); ur=ur.move(width,height); return ur; }
	public String toString() { return super.toString() + " -> " + getur() ; }
	boolean equals(Rectangle that) {
		if (super.equals(that)) {
			return (width==that.width && height==that.height);
		}
		return false;
	}
	

}
