please in easy way and c++
3. Write a function distance that calculates the Cartesian distance between two points (xl, y1) and (x2, y2). All numbers and return values should be of type double. Include such function in a program that reads three points and determine the closest two points to each other’s. Output of the program should be something like the following Enter the three points coordinates sequentially (xl yl x2 y2 x3 y3): 342156 closest distance
OR
OR