ppoint2.cpp
来自「it is a usefull thing」· C++ 代码 · 共 26 行
CPP
26 行
//=====================================
// PPoint2.cpp
// 极坐标版本
//=====================================
#include"ppoint.h"
#include<cmath>
using namespace std;
//-------------------------------------
void PPoint::set(double ix,double iy){
x=atan2(iy, ix);
y=sqrt(ix*ix+iy*iy);
}//------------------------------------
double PPoint::xOffset(){
return y*cos(x);
}//------------------------------------
double PPoint::yOffset(){
return y*sin(x);
}//------------------------------------
double PPoint::angle(){
return (180/3.14159)*x;
}//------------------------------------
double PPoint::radius(){
return y;
}//------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?