# Example 3 of Applet in which 3 moving points in three-dimensional space "induce" 8 geometric medians on a sphere.

Let Pi=(xi,yi,zi) n moving points in ℝ³ (lP:={P1,P2,...,Pn}). I want to find  the points P=(x,y,z) on the surface of the sphere -S (radius R) that are critical (relative min/max or saddle points at (x,y,z)) of a function f(x,y,z):=-sum of the distances from P to the all points from lP. Critical points can be found using Lagrange multipliersas finding the Extreme values of the function f(x,y,z) subject to a constraining equation g(x,y,z):=x2+y2+z2-R2=0. There is a system of equations: ∇f(x,y,z)= λ∇g(x,y,z). A local optimum occurs when ∇f(x,y,z) and ∇g(x,y,z) are parallel, and so ∇f is some multiple of ∇g. This applet is used to study the distribution of geometric medians on a sphere of radius R, „induces“ by the discrete sample of 3 movable points in the 3-D space. Description is in https://www.geogebra.org/m/y8dnkeuu. The type of critical points is specified using the hessian matrix in the applet.