ppoint.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:

C#编程

开发平台:

Visual C++

  1. //=====================================
  2. // ppoint.cpp
  3. //=====================================
  4. #include"ppoint.h"
  5. #include<cmath>
  6. using namespace std;
  7. //-------------------------------------
  8. PPoint::PPoint(double ix, double iy){
  9.   x=ix;  y=iy;
  10. }//------------------------------------
  11. double PPoint::xOffset(){
  12.   return x;
  13. }//------------------------------------
  14. double PPoint::yOffset(){
  15.   return y;
  16. }//------------------------------------
  17. double PPoint::angle(){
  18.   return (180/3.14159)*atan2(y,x);
  19. }//------------------------------------
  20. double PPoint::radius(){
  21.   return sqrt(x*x+y*y);
  22. }//------------------------------------
  23.