In the x-y plane, the general equation of a circle of radius r is given by: (x - a)2 + (y - b)2 = r2.
Implement a Circle class. Each object of this class will represent a circle, storing its radius (r) and the a and b coordinates of its center as doubles.
The class must include
a default constructor function whose prototype is
Circle(double radius, double centerX, double centerY);
to set (initialize) radius and center coordinates.
a member function named double area() that returns the area of the circle.
a member function named double circ() that returns circumference.
a member function named bool isInside(double x, double y) that returns true if the given point (x, y) is inside the circle and
returns false otherwise.
[code]
#include<iostream>
using namespace std;
class circle {
private:
double m_r;
double m-cx;
double m_cy;
public:
circle(double,double,double);
double area() {return(3.14*m_r*m_r); }
double circ() {return(3.14*m_r);}
bool isİnside(double x,double y);
}
int main () {
circle guzelcember (10.0,0.0,0.0);
cout<<guzelcember.area()<<endl;
cout<<guzelcember.circ()<<endl;
cout<<guzelcember.isİnside(1.5,2.7)<<endl;
return 0;
}
// Constructor function
circle::(double radius,double centerX,double centerY) {
m_r=radius;
m_cx=centerX;
m_cy=centerY;
}
bool circle::isİnside(double x,double y) {
I couldnt write this function and I cant continue to write code.Can anybody help me please?