Point to lie on a circle. Help!
Please, would you help me with this program:
Code:
#include <iostream>
#include <cmath>
using namespace std;
void main()
{
cout << "x = ";
double x;
cin >> x;
cout << "y = ";
double y;
cin >> y;
bool c1 = ((((x + 1)*(x + 1) + (y - 1)*(y - 1)) <= 1) &&
(y <= (1/3*x + 1)) &&
(y >= (x + 1)) &&
(y >= 0));
if (c1)
cout << "true" << endl;
else
cout << "false" << endl;
}
http://img38.imageshack.us/img38/8481/cird.png Uploaded with ImageShack.us
The point don`t have to lie in (-2, 0.5), (-2, 1) and (0,1). :S