point.h
来自「it is a usefull thing」· C头文件 代码 · 共 30 行
H
30 行
//=====================================
// point.h
//=====================================
#ifndef HEADER_POINT
#define HEADER_POINT
//-------------------------------------
#include<iostream>
using namespace std;
//-------------------------------------
class Point{
protected:
double x, y;
public:
static double PI;
public:
Point(double a=0, double b=0);
double xOffset()const;
double yOffset()const;
double angle()const;
double radius()const;
Point operator+(const Point& d)const;
Point& operator+=(const Point& d);
void moveTo(double a, double b);
friend inline ostream& operator<<(ostream& o, const Point& d){
return o<<'('<<d.x<<','<<d.y<<')'<<'\n';
}
};//===================================
#endif // HEADER_POINT
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?