Suppose we have the following two points in a 3D space:
The distance between point1 and point2 is:
Please create ThreeD class inherited from Point class which is used in previous exercise and then use ThreeD class to calculate the distance between two 3D points.
Hint:
class ThreeD:public Point
ThreeD(double i, double j, double k):Point(i,j){z = k;}
Example input:
1 1 1 2 3 4
Example output:
Distance is: 3.74166