Geometric median of 4 points

Topic:
Vectors
This activity belongs to the GeoGebra book Attractive projects. 2D project: create automatic dynamic demonstrations. The Fermat point minimizes the sum of the distances to 3 points. If we add a point, we obtain the geometric median of four points. Note that this median coincides either with the cut point of the diagonals of the quadrilateral or with one of the four points. The latter only occurs when that point is inside the triangle formed by the other three, that is, when the quadrilateral is not convex. As before, the robot (orange point F) aims to minimize the expression: dif = abs(F-A) + abs(F-B) + abs(F-C) + abs(F-D)