#include #include #include "point.h" using namespace std; int main() { //A 3-4-5 right triangle with right angle at the origin. const point A(3, 0); const point B(0, 4); const point C; cout << "A's distance from origin is " << A.dist() << ".\n" << "The distance between A and B is " << dist(A, B) << ".\n" << "The area of triangle ABC is " << area(A, B, C) << ".\n"; cout << "The midpoint of A and B is "; const point M = midpoint(A, B); M.print(); cout << ".\n"; cout << "The address of midpoint is " << reinterpret_cast(reinterpret_cast(midpoint)) << ".\n"; cout << "A, B, and M are " << (collinear(A, B, M) ? "" : "not ") << "collinear.\n"; //Borderline case: M is on on the perimeter. cout << "Triangle ABC " << (contains(A, B, C, M) ? "contains" : "does not contain") << " M.\n"; return EXIT_SUCCESS; }