In geometry the Fermat point of a triangle, also called Torricelli point, is a point such that the total distance from the three vertices of the triangle to the point is the minimum. It is so named because this problem is first raised by Fermat in a private letter. In the following picture, P0
is the Fermat point. You may have already known the property that:
Alice and Bob are learning geometry. Recently they are studying about the Fermat Point.
Alice: I wonder whether there is a similar point for quadrangle.
Bob: I think there must exist one.
Alice: Then how to know where it is? How to prove?
Bob: I don’t know. Wait… the point may hold the similar property as the case in triangle.
Alice: It sounds reasonable. Why not use our computer to solve the problem? Find the Fermat point, and then verify your assumption.
Bob: A good idea.
So they ask you, the best programmer, to solve it. Find the Fermat point for a quadrangle, i.e. find a point such that the total distance from the four vertices of the quadrangle to that point is the minimum.