#include
#include
using namespace std;
class Point {
public:
Point() {x = 0; y = 0; }
Point(double xv,double yv) {x = xv;y = yv;}
Point(Point& pt) { x = pt.x; y = pt.y; }
double getx() { return x; }
double gety() { return y; }
double Area() { return 0; }
void Show() { cout<<"x="<private:
double x,y;
};
class Rectangle:public Point{
double a,b;
double l;
double w;
public:
Rectangle(double aa,double bb,double ll,double ww):Point(aa,bb),a(aa),b(bb),l(ll),w(ww){
}
void position(Point& pt){
if(pt.getx()>a && pt.getx()b-w && pt.gety() else if((pt.getx()==a &&(pt.gety()>=b-w && pt.gety()<=b)) || (pt.getx()==a+l &&(pt.gety()>=b-w && pt.gety()<=b)) || (pt.gety()==b && (pt.getx()>=a && pt.getx()<=a+l)) || (pt.gety()==b-w && (pt.getx()>=a && pt.getx()<=a+l))){
cout<<"The point is at the edge of the rectangle!"< }
else cout<<"The point is out of the rectangle!"< }
double Area(){
return l*w;
}
};
class Circle:public Point{
double a,b;
double r;
public:
Circle(double aa,double bb,double rr):Point(aa,bb),a(aa),b(bb),r(rr){
}
void position(Point& pt){
double d=sqrt((pt.getx()-a)*(pt.getx()-a)+(pt.gety()-b)*(pt.gety()-b));
if(d else if (d==r) cout<<"The point is on the circle!"< else cout<<"The point is out of the circle!"< }
double Area(){
return 3.14*r*r;
}
};
//TEST!!!
/*******
int main(){
Point p(1,2);
Rectangle r(0,2,4,2);
cout<<"The area of rectangle: "< r.position(p);
Circle c(0,2,1);
cout<<"The area of circle: "< c.position(p);
}
*/