⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ppoint2.cpp

📁 it is a usefull thing
💻 CPP
字号:
//=====================================
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -