From 110481bee48bdb18f3d635cbc507aac1acc7c694 Mon Sep 17 00:00:00 2001 From: angeld55 Date: Tue, 24 May 2022 20:10:50 +0300 Subject: added shapes collection --- Sem. 12/Example_polymorphism/Circle.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Sem. 12/Example_polymorphism/Circle.cpp') diff --git a/Sem. 12/Example_polymorphism/Circle.cpp b/Sem. 12/Example_polymorphism/Circle.cpp index 8226582..c0368a0 100644 --- a/Sem. 12/Example_polymorphism/Circle.cpp +++ b/Sem. 12/Example_polymorphism/Circle.cpp @@ -13,4 +13,9 @@ double Circle::getArea() const double Circle::getPer() const { return 2 * PI * radius; -} \ No newline at end of file +} +bool Circle::isPointIn(int x, int y) const +{ + Shape::point p(x, y); + return p.getDist(getPointAtIndex(0)) <= radius; +} -- cgit v1.3.1-23-gd82d