package lab02;

class Rectangle {
	// Fields
	Point ll;
	double wid;
	double hgt;

	// Creation method
	public Rectangle(Point lli, double widi, double hgti) {
		ll=lli;
		wid=widi;
		hgt=hgti;
	}

	void move(double xm, double ym) {
		ll.move(xm,ym);
	}

	void grow(double factor) {
		wid *=factor;
		hgt *=factor;
	}

	public String toString() {
		return "Rectangle from " + ll + " width=" + wid + " height="+ hgt;
	}

	boolean contains(Point xy) {
		if (xy.getx() < ll.getx()) return false;
		if (xy.getx() > (ll.getx() + wid)) return false;
		if (xy.gety() < ll.gety()) return false;
		if (xy.gety() > (ll.gety() + hgt)) return false;
		return true;
	}
}