#include <iostream>
#include <string>
using namespace std;
const double PI = 3.14;
class Circle1 {
public :
double radius = 1;
double calculate() {
return 2 * PI * radius;
}
};
class Student {
private:
string name;
int number;
public:
void setName(string name) {
this->name = name;
}
void setNumber(int number) {
this->number = number;
}
void printInformation() {
cout << "姓名:" << this->name << endl;
cout << "学号:" << this->number << endl;
}
};
class person {
public:
string m_Name;
protected:
string m_Car;
private:
int m_Password;
public:
void func() {
m_Name = "张三";
m_Car = "拖拉机";
m_Password = 123456;
}
};
class Cube {
private:
double length = 0;
double width = 0;
double height = 0;
public:
void setLength(int length) {
this->length = length;
}
void setWidth(int width) {
this->width = width;
}
void setHeight(int height) {
this->height = height;
}
double getLength() {
return this->length;
}
double getWidth() {
return this->width;
}
double getHeight() {
return this->height;
}
double getArea() {
return 2 * (length * width + length * height + width * height);
}
double getVolume() {
return length * width * height;
}
bool equals(Cube& c2) {
if(height == c2.getHeight()
&& length== c2.getLength()
&& width== c2.getWidth()) {
return true;
}
else {
return false;
}
}
};
bool isEquals(Cube& c1,Cube &c2) {
if (c1.getHeight() == c2.getHeight()
&& c1.getLength() == c2.getLength()
&& c1.getWidth() == c2.getWidth() ) {
return true;
}
else{
return false;
}
}
class Point {
private:
int X;
int Y;
public:
void setX(int X) {
this->X = X;
}
int getX() {
return this->X;
}
void setY(int Y) {
this->Y = Y;
}
int getY() {
return this->Y;
}
int getDistance() {
return 0;
}
};
class Circle {
private:
int radius;
Point center;
public:
void setCenter(Point p) {
this->center = p;
}
void setRadius(int radius) {
this->radius = radius;
}
Point getCenter() {
return center;
}
int getRadius() {
return radius;
}
};
void isInCircle(Circle &c,Point &p){
int distance =
(c.getCenter().getX() - p.getX()) * (c.getCenter().getX() - p.getX()) +
(c.getCenter().getY() - p.getY()) * (c.getCenter().getY() - p.getY());
int rDistance = c.getRadius() * c.getRadius();
if(distance == rDistance){
cout << "点在圆上" << endl;
}
else if(distance > rDistance){
cout << "点在圆外" << endl;
}
else {
cout << "点在圆内" << endl;
}
}
int main12() {
Circle c;
c.setRadius(10);
Point center;
center.setX(10);
center.setY(0);
c.setCenter(center);
Point p;
p.setX(10);
p.setY(9);
isInCircle(c,p);
system("pause");
return 0;
}