Compute Nearest Points 

For a point and a region, the nearest point in that region to the given point can be computed. The nearest point is given by ArgMin[, x], where p is the given point and R is the region.

Some regions have simple closed-form representation for the nearest point.

In[1]:=
Click for copyable input
X
Out[1]=
In[2]:=
Click for copyable input
X
Out[2]=

Others are more involved.

In[3]:=
Click for copyable input
X
Out[3]=

Visualize the different case where there is a different nearest projector function.

In[4]:=
Click for copyable input
X
In[5]:=
Click for copyable input
X
In[6]:=
Click for copyable input
X
Out[6]=

Similarly for a standard tetrahedron.

In[7]:=
Click for copyable input
X
Out[7]=
In[8]:=
Click for copyable input
X
In[9]:=
Click for copyable input
X
Out[9]=
de es ja pt-br zh