#include<iostream>
using namespace std;
class Point
{
private:
int m_X;
int m_Y;
public:
void setX(int x)
{
m_X = x;
}
void setY(int y)
{
m_Y = y;
}
int getX()
{
return m_X;
}
int getY()
{
return m_Y;
}
};
class Circle
{
private:
int m_R = 0;
Point Center;
public:
void setR(int r)
{
m_R = r;
}
int getR()
{
return m_R;
}
void setCenter(int x, int y)
{
Center.setX(x);
Center.setY(y);
}
void judgement(Point& P)
{
/*cout << P.getX() << endl;
cout << getCenterX() << endl;
cout << P.getY() << endl;
cout << getCenterY() << endl;*/
int distance = (P.getX() - Center.getX()) * (P.getX() - Center.getX())
+ (P.getY() - Center.getY()) * (P.getY() - Center.getY());
//cout << distance << endl;
if (distance < (getR() * getR()))
{
cout << "点在圆内" << endl;
}
else if (distance == (getR() * getR()))
{
cout << "点在圆上" << endl;
}
else
{
cout << "点在圆外" << endl;
}
}
};
int main()
{
Point P;
P.setX(3);
//cout << P.getX() << endl;
P.setY(3);
//cout << P.getY() << endl;
Circle C;
C.setCenter(0, 0);
C.setR(5);
//cout << C.getCenterX() << endl;
C.judgement(P);
system("pause");
return 0;
}