# Point on a plane closest to the origin

Consider the plane with equation $x-y+z=1.$ Find the point on the plane closest to the origin.

I think I need to find a function for the distance between the plane and the origin and then find it's derivative and set it equal to zero. I'm not sure exactly how to go about doing this though. Any ideas?

The perpendicular vector to the plane is in the direction of $v = (1,-1,1)$. Start at the origin and travel in a straight line in the direction of $v$. You will hit the plane at the point that minimises the distance.

With $z=1-x+y$, the squared distance of a point to the origin is

$$d^2=x^2+y^2+(1-x+y)^2.$$

You minimize it by canceling the derivatives on $x,y$:

$$2x-2(1-x+y)=0,\\2y+2(1-x+y)=0.$$

There is a single solution, $(\frac13,-\frac13,\frac13)$, and $d^2=\frac13$.

Mathematically the equation for a plane is $$\left. \boldsymbol{n} \cdot \pmatrix{x \\ y \\ z} = d \; \right\} n_x x + n_y y + n_z z = d$$ which is explained as any point $$(x,y,z)$$ whose projection along the plane normal vector $$\boldsymbol{n} = (n_x,n_y,n_z)$$ is at a distance $$d$$ from the origin. It is required that the normal is a unit vector $$\| \boldsymbol{n} \| = 1$$.

To find the distance of a point $$\boldsymbol{p} = (p_x,p_y,p_z)$$ to the plane, take any point on the plane $$\boldsymbol{r}=(x,y,z)$$ and project along the plane normal

\begin{aligned} (\text{distance}) & = \boldsymbol{n} \cdot \left( \boldsymbol{p} - \boldsymbol{r} \right) = \boldsymbol{n}\cdot \boldsymbol{p} - d \\ & = n_x p_x + n_y p_y + n_z p_z -d \end{aligned}

As a side note, if the distance is positive then the point is away from the origin relative to the plane, and if negative the point is nearer the origin than the plane.

If the equation of the plane is given by $$a x + b y + c z = d$$ then you can use the above, but scale it to the magnitude of the $$(a,b,c)$$ vector.

$$\boxed{ (\text{distance}) = \frac{a\, p_x + b\, p_y + c\, p_z - d}{\sqrt{a^2+b^2+c^2}} }$$

The point on the plane $$ax+by+cz=d$$ nearest the origin is $$\biggl(\frac{da}{\sqrt{a^2+b^2+c^2}}, \frac{db}{\sqrt{a^2+b^2+c^2}}, \frac{dc}{\sqrt{a^2+b^2+c^2}}\biggr)$$

Here, the point on the plane $$x-y+z=1$$ nearest the origin is $$\Biggl(\frac{1\times1}{\sqrt{1^2+(-1)^2+1^2}}, \frac{1\times-1}{\sqrt{1^2+(-1)^2+1^2}}, \frac{1\times1}{\sqrt{1^2+(-1)^2+1^2}}\Biggr) = \biggl(\frac{1}{\sqrt3}, \frac{-1}{\sqrt3}, \frac{1}{\sqrt3}\biggr)$$

This is an extension into three dimensions of the two dimensional nearest point to the origin on the line $$ax+by=c$$ is $$\Bigl(\frac{ca}{\sqrt{a^2+b^2}}, \frac{cb}{\sqrt{a^2+b^2}}\Bigr)$$, which is the point of intersection of $$ax+by=c$$ and $$bx-ay=0$$, perpendicular and passing through the origin.

• I think it should be $\biggl(\frac{da}{a^2+b^2+c^2}, \frac{db}{a^2+b^2+c^2}, \frac{dc}{a^2+b^2+c^2}\biggr)$ – OkkesDulgerci Nov 21 '19 at 1:59