ppoint.cpp

来自「it is a usefull thing」· C++ 代码 · 共 25 行

CPP
25
字号
//=====================================
// ppoint.cpp
// 直角坐标版本
//=====================================
#include"ppoint.h"
#include<cmath>
using namespace std;
//-------------------------------------
void PPoint::set(double ix, double iy){
  x=ix;  y=iy;
}//------------------------------------
double PPoint::xOffset(){
  return x;
}//------------------------------------
double PPoint::yOffset(){
  return y;
}//------------------------------------
double PPoint::angle(){
  return (180/3.14159)*atan2(y,x);
}//------------------------------------
double PPoint::radius(){
  return sqrt(x*x+y*y);
}//------------------------------------

 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?