#include #include using namespace std; #include "circle.hpp" #include "polygon.hpp" main(){ // construct circle double radius = 5., centerx = -1., centery = 1.; circle C(radius, centerx, centery); // compute area exactly for circle cout << " circle has area " << C.compute_area(0.) << endl; // test inclusion function double x = 0.5, y = 0.1; if(C.point_inclusion_test(x,y) == 1) cout << "( " << x << "," << y << ") is in the circle " << endl; else cout << "( " << x << "," << y << ") is not in the circle " << endl; // construct polygon polygon P("polygon2.poly"); // compute area approximately for polygon double tol = 1e-3; cout << " polygon has (approximate) area " << P.compute_area(tol) << endl; // test inclusion function if(P.point_inclusion_test(x,y) == 1) cout << "( " << x << "," << y << ") is in the polygon " << endl; else cout << "( " << x << "," << y << ") is not in the polygon " << endl; }