Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Shapes / Circle.cpp
blob: e625123124550e30009add70399e675ed5201dbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "Circle.h"

Circle::Circle(int x, int y, int r) : Shape(1), radius(r)
{
	setPoint(x, y, 0);
}
double Circle::getArea()
{
	return PI * radius * radius;
}
double Circle::getPer()
{
	return 2 * PI * radius;
}
Shape* Circle::clone()
{
	Circle* newCircle = new Circle(*this);
	return newCircle;
}