//StudybarCommentBegin
#include <iostream>
#include <cmath>
using namespace std;
class Point
{
protected:
double x, y;
public:
void SetPoint(double x = 0, double y = 0)
{
this->x = x; this->y = y;
}
double GetX() const { return x; }
double GetY() const { return y; }
void Move(double xOff, double yOff){
x += xOff; y += yOff;
}
double Dist(Point const &p) const {
double tmpx = x - p.x;
double tmpy = y - p.y;
return ::sqrt(tmpx*tmpx + tmpy*tmpy);
}
};
class Rectangle : public Point
{
public:
void SetRect(double x, double y, double w, double h)
{
SetPoint(x, y); this->w = w; this->h = h;
}
double GetW() const { return w; }
double GetH() const { return h; }
double DistOfTwoR(const Rectangle &R) {
double tmpx = x - R.x;
double tmpy = y - R.y;
return ::sqrt(tmpx*tmpx + tmpy*tmpy);
}
protected:
double w, h;
};
//StudybarCommentEnd
class RectWithAngle : public Rectangle
{
protected:
double ang;
public:
RectWithAngle(double x, double y, double w, double h, double angle)
{
Rectangle::SetRect(x, y, w, h); this->ang = angle;
}
const char* IsPointInMe(Point p) const
{
p.Move(-x, -y);
double s = ::sin(-ang);
double c = ::cos(-ang);
double x = p.GetX()*c - p.GetY()*s;
double y = p.GetX()*s + p.GetY()*c;
if (x >= 0 && y>= 0 && x<=w && y<= h)
return "在区域内";
return "不在区域内";
}
};
// StudybarCommentBegin
int main()
{
double angle;
cin >> angle;
RectWithAngle R1(2, 3, 3, 4, angle);
R1.Move(1, 1);
Point p;
p.SetPoint(4.5, 4);
cout << R1.IsPointInMe(p);
return 0;
}
//StudybarCommentEnd