#include <iostream> //for the object cout #include <cmath> //for the function sqrt #include "point.h" //Definitions of non-inline functions: point::point(double initial_x, double initial_y) : x {initial_x}, y {initial_y} { } void point::print() const { cout << "(" << x << ", " << y << ")"; } double distance(const point& A, const point& B) //friend { const double dx {A.x - B.x}; //horizontal distance const double dy {A.y - B.y}; //vertical distance return sqrt(dx*dx + dy*dy); //diagonal distance }