circle_compos.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- //=====================================
- // circle_compos.cpp
- //=====================================
- #include"point.h"
- #include"circle_compos.h"
- //-------------------------------------
- Circle::Circle(const Point& p, double r):point(p),radius(r){}
- double Circle::getRadius()const{ return radius; }
- Point Circle::getPoint()const{ return point; }
- double Circle::getArea()const{ return radius * radius * Point::PI; }
- double Circle::getCircum()const{ return 2 * radius * Point::PI; }
- void Circle::moveTo(double a, double b){ point.moveTo(a, b); }
- void Circle::modifyRadius(double r){ radius = r; }