Distance from a point to a plane
In Euclidean space, the point on a plane  that is closest to the origin has the Cartesian coordinates
 that is closest to the origin has the Cartesian coordinates  , where
, where
 . .
From this the distance from the origin to the plane can be found. If what is desired is the distance from a point not at the origin to the nearest point on a plane, this can be found by a change of variables that moves the origin to coincide with the given point.
Converting general problem to distance-from-origin problem
Suppose we wish to find the nearest point on a plane to the point (X0, Y0, Z0), where the plane is given by aX + bY + cZ = D. We define x = X - X0, y = Y - Y0, z = Z - Z0, and d = D - aX0 - bY0 - cZ0, to obtain ax + by + cz = d as the plane expressed in terms of the transformed variables. Now the problem has become one of finding the nearest point on this plane to the origin, and its distance from the origin. The point on the plane in terms of the original coordinates can be found from this point using the above relationships between x and X, between y and Y, and between z and Z; the distance in terms of the original coordinates is the same as the distance in terms of the revised coordinates.
Restatement using linear algebra
The formula for the closest point to the origin may be expressed more succinctly using notation from linear algebra. The expression  in the definition of a plane is a dot product
 in the definition of a plane is a dot product  ,
and the expression
,
and the expression  appearing in the solution is the squared norm
 appearing in the solution is the squared norm  . Thus, if
. Thus, if  is a given vector,
the plane may be described as the set of vectors
 is a given vector,
the plane may be described as the set of vectors  for which
 for which  and the closest point on this plane is the vector
 and the closest point on this plane is the vector
The Euclidean distance from the origin to the plane is the norm of this point,
 . .
Why this is the closest point
In either the coordinate or vector formulations, one may verify that the given point lies on the given plane by plugging the point into the equation of the plane.
To see that it is the closest point to the origin on the plane, observe that  is a scalar multiple of the vector
 is a scalar multiple of the vector  defining the plane, and is therefore orthogonal to the plane.
Thus, if
 defining the plane, and is therefore orthogonal to the plane.
Thus, if  is any point on the plane other than
 is any point on the plane other than  itself, then the line segments from the origin to
 itself, then the line segments from the origin to  and from
 and from  to
 to  form a right triangle, and by the Pythagorean theorem the distance from the origin to
 form a right triangle, and by the Pythagorean theorem the distance from the origin to  is
 is
 . .
Since  must be a positive number, this distance is greater than
 must be a positive number, this distance is greater than  , the distance from the origin to
, the distance from the origin to  .[2]
.[2]
Alternatively, it is possible to rewrite the equation of the plane using dot products with  in place of the original dot product with
 in place of the original dot product with  (because these two vectors are scalar multiples of each other) after which the fact that
 (because these two vectors are scalar multiples of each other) after which the fact that  is the closest point becomes an immediate consequence of the Cauchy–Schwarz inequality.[1]
 is the closest point becomes an immediate consequence of the Cauchy–Schwarz inequality.[1]
Closest point and distance for a hyperplane and arbitrary point
The vector equation for a hyperplane in  -dimensional Euclidean space
-dimensional Euclidean space  through a point
 through a point  with normal vector
 with normal vector  is
 is  or
 or  where
 where  .[3]
The corresponding Cartesian form is
.[3]
The corresponding Cartesian form is  where
 where  .[3]
.[3]
The closest point on this hyperplane to an arbitrary point  is
 is
![\mathbf{x}=\mathbf{y}-\left[\dfrac{(\mathbf{y}-\mathbf{p})\cdot\mathbf{a}}{\mathbf{a}\cdot\mathbf{a}}\right]\mathbf{a}=\mathbf{y}-\left[\dfrac{\mathbf{y}\cdot\mathbf{a}-d}{\mathbf{a}\cdot\mathbf{a}}\right]\mathbf{a}](../I/m/ec4681e9b7682252d3d420c4d47723f0.png) and the distance from
and the distance from  to the hyperplane is
 to the hyperplane is
![\left\|\mathbf{x}-\mathbf{y}\right\| = \left\|\left[\dfrac{(\mathbf{y}-\mathbf{p})\cdot\mathbf{a}}{\mathbf{a}\cdot\mathbf{a}}\right]\mathbf{a}\right\|=\dfrac{\left|(\mathbf{y}-\mathbf{p})\cdot\mathbf{a}\right|}{\left\|\mathbf{a}\right\|}=\dfrac{\left|\mathbf{y}\cdot\mathbf{a}-d\right|}{\left\|\mathbf{a}\right\|}](../I/m/7132d7dcd94d4bc1888f71c5bf6924ec.png) .[3]
.[3]
Written in Cartesian form, the closest point is given by  for
 for  where
 where
 ,
and the distance from
,
and the distance from  to the hyperplane is
 to the hyperplane is
 .
.
Thus in  the point on a plane
 the point on a plane  closest to an arbitrary point
 closest to an arbitrary point  is
 is  given by
 given by
 where
where  ,
and the distance from the point to the plane is
,
and the distance from the point to the plane is  .
.
See also
References
- 1 2 Strang, Gilbert; Borre, Kai (1997), Linear Algebra, Geodesy, and GPS, SIAM, pp. 22–23, ISBN 9780961408862.
- 1 2 Shifrin, Ted; Adams, Malcolm (2010), Linear Algebra: A Geometric Approach (2nd ed.), Macmillan, p. 32, ISBN 9781429215213.
- 1 2 3 Cheney, Ward; Kincaid, David (2010). Linear Algebra: Theory and Applications. Jones & Bartlett Publishers. pp. 450,451. ISBN 9781449613525.
 .
.