40 lines · c
1#pragma once2 3#include "Shape.h"4 5/**6 * @brief Circle class derived from Shape.7 *8 * Represents a circle with a given radius.9 */10class Circle : public Shape {11public: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 * @code30 * Circle circle(5.0);31 * double perimeter = circle.perimeter();32 * @endcode33 * @return double The perimeter of the circle.34 */35 double perimeter() const override;36 37private:38 double radius_; ///< Radius of the circle.39};40