Supriya Ghosh (Editor)

Distance from a point to a plane

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In Euclidean space, the point on a plane a x + b y + c z = d that is closest to the origin has the Cartesian coordinates ( x , y , z ) , where

Contents

x = a d a 2 + b 2 + c 2 , y = b d a 2 + b 2 + c 2 , z = c d a 2 + b 2 + c 2 .

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 a x + b y + c z in the definition of a plane is a dot product ( a , b , c ) ( x , y , z ) , and the expression a 2 + b 2 + c 2 appearing in the solution is the squared norm | ( a , b , c ) | 2 . Thus, if v = ( a , b , c ) is a given vector, the plane may be described as the set of vectors w for which v w = d and the closest point on this plane is the vector

p = v d | v | 2 .

The Euclidean distance from the origin to the plane is the norm of this point,

d | v | = d a 2 + b 2 + c 2 .

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 p is a scalar multiple of the vector v defining the plane, and is therefore orthogonal to the plane. Thus, if q is any point on the plane other than p itself, then the line segments from the origin to p and from p to q form a right triangle, and by the Pythagorean theorem the distance from the origin to q is

| p | 2 + | p q | 2 .

Since | p q | 2 must be a positive number, this distance is greater than | p | , the distance from the origin to p .

Alternatively, it is possible to rewrite the equation of the plane using dot products with p in place of the original dot product with v (because these two vectors are scalar multiples of each other) after which the fact that p is the closest point becomes an immediate consequence of the Cauchy–Schwarz inequality.

Closest point and distance for a hyperplane and arbitrary point

The vector equation for a hyperplane in n -dimensional Euclidean space R n through a point p with normal vector a 0 is ( x p ) a = 0 or x a = d where d = p a . The corresponding Cartesian form is a 1 x 1 + a 2 x 2 + + a n x n = d where d = p a = a 1 p 1 + a 2 p 2 + a n p n .

The closest point on this hyperplane to an arbitrary point y is x = y [ ( y p ) a a a ] a = y [ y a d a a ] a and the distance from y to the hyperplane is x y = [ ( y p ) a a a ] a = | ( y p ) a | a = | y a d | a .

Written in Cartesian form, the closest point is given by x i = y i k a i for 1 i n where k = y a d a a = a 1 y 1 + a 2 y 2 + a n y n d a 1 2 + a 2 2 + a n 2 , and the distance from y to the hyperplane is | a 1 y 1 + a 2 y 2 + a n y n d | a 1 2 + a 2 2 + a n 2 .

Thus in R 3 the point on a plane a x + b y + c z = d closest to an arbitrary point ( x 1 , y 1 , z 1 ) is ( x , y , z ) given by x = x 1 k a y = y 1 k b z = z 1 k c } where k = a x 1 + b y 1 + c z 1 d a 2 + b 2 + c 2 , and the distance from the point to the plane is | a x 1 + b y 1 + c z 1 d | a 2 + b 2 + c 2 .

References

Distance from a point to a plane Wikipedia