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

const double PI = 3.1415;
Circle::Circle(double x, double y, double radius) : Shape(1), radius(radius)
{
	setPoint(0, x, y);
}

double Circle::getArea() const
{
	return PI * radius * radius;
}
double Circle::getPer() const
{
	return 2 * PI * radius;
}

Shape* Circle::clone() const
{
	Circle* copy = new Circle(*this);
	return copy;
}