| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "Shape.h" |
| 4 |
|
| 5 |
/** |
| 6 |
* @brief Circle class derived from Shape. |
| 7 |
* |
| 8 |
* Represents a circle with a given radius. |
| 9 |
*/ |
| 10 |
class Circle : public Shape { |
| 11 |
public: |
| 12 |
/** |
| 13 |
* @brief Constructs a new Circle object. |
| 14 |
* |
| 15 |
* @param radius Radius of the circle. |
| 16 |
*/ |
| 17 |
Circle(double radius); |
| 18 |
|
| 19 |
/** |
| 20 |
* @brief Calculates the area of the circle. |
| 21 |
* |
| 22 |
* @return double The area of the circle. |
| 23 |
*/ |
| 24 |
double area() const override; |
| 25 |
|
| 26 |
/** |
| 27 |
* @brief Calculates the perimeter of the circle. |
| 28 |
* |
| 29 |
* @return double The perimeter of the circle. |
| 30 |
*/ |
| 31 |
double perimeter() const override; |
| 32 |
|
| 33 |
private: |
| 34 |
double radius_; ///< Radius of the circle. |
| 35 |
}; |