# Plane Equation

The equation of a plane in 3D space is defined with normal vector (perpendicular to the plane) and a known point on the plane.

Graph of a plane in 3D
Let the normal vector of a plane, and the known point on the plane, P_{1}. And, let any point on the plane as P.

We can define a vector connecting from P_{1} to P, which is lying on the plane.

Since the vector and the normal vector are perpendicular each other, the dot product of two vector should be 0.

This dot product of the normal vector and a vector on the plane becomes the equation of the plane. By calculating the dot product, we get;

If we substitute the constant terms to , then the plane equation becomes simpler;

### Distance from Origin

If the normal vector is normalized (unit length), then the constant term of the plane equation, *d* becomes the distance from the origin.

Plane with unit normal
If the unit normal vector (a_{1}, b_{1}, c_{1}), then, the point P_{1} on the plane becomes (*D*a_{1}, *D*b_{1}, *D*c_{1}), where *D* is the distance from the origin. The equation of the plane can be rewritten with the unit vector and the point on the plane in order to show the distance *D* is the constant term of the equation;

Therefore, we can find the distance from the origin by dividing the standard plane equation by the length (norm) of the normal vector (normalizing the plane equation). For example, the distance from the origin for the following plane equation with normal (1, 2, 2) is 2;

### Distance from a Point

Distance between Plane and Point
The shortest distance from an arbitrary point P_{2} to a plane can be calculated by the dot product of two vectors and , projecting the vector to the normal vector of the plane.

The distance *D* between a plane and a point P_{2} becomes;

The numerator part of the above equation, is expanded;

Finally, we put it to the previous equation to complete the distance formula;

Note that the distance formula looks like inserting P_{2} into the plane equation, then dividing by the length of the normal vector. For example, the distance from a point (-1, -2, -3) to a plane x + 2y + 2z - 6 = 0 is;

Notice this distance is signed; can be negative value. It is useful to determine the direction of the point. For example, if the distance is positive, the point is in the same side where the normal is pointing to. And, a negative distance means the point is in opposite side.