Hesse normal form

The Hesse normal form named after Otto Hesse, is an equation used in analytic geometry, and describes a line in $$\mathbb{R}^2$$ or a plane in Euclidean space $$\mathbb{R}^3$$ or a hyperplane in higher dimensions. It is primarily used for calculating distances (see point-plane distance and point-line distance).

It is written in vector notation as


 * $$\vec r \cdot \vec n_0 - d = 0.\,$$

The dot $$\cdot$$ indicates the scalar product or dot product. Vector $$\vec r$$ points from the origin of the coordinate system, O, to any point P that lies precisely in plane or on line E. The vector $$\vec n_0$$ represents the unit normal vector of plane or line E. The distance $$d \ge 0$$ is the shortest distance from the origin O to the plane or line.

Derivation/Calculation from the normal form
Note: For simplicity, the following derivation discusses the 3D case. However, it is also applicable in 2D.

In the normal form,


 * $$(\vec r -\vec a)\cdot \vec n = 0\,$$

a plane is given by a normal vector $$\vec n$$ as well as an arbitrary position vector $$\vec a$$ of a point $$A \in E$$. The direction of $$\vec n$$ is chosen to satisfy the following inequality


 * $$\vec a\cdot \vec n \geq 0\,$$

By dividing the normal vector $$\vec n$$ by its magnitude $$| \vec n |$$, we obtain the unit (or normalized) normal vector


 * $$\vec n_0 = {{\vec n} \over {| \vec n |}}\,$$

and the above equation can be rewritten as


 * $$(\vec r -\vec a)\cdot \vec n_0 = 0.\,$$

Substituting


 * $$d = \vec a\cdot \vec n_0 \geq 0\,$$

we obtain the Hesse normal form


 * $$\vec r \cdot \vec n_0 - d = 0.\,$$



In this diagram, d is the distance from the origin. Because $$\vec r \cdot \vec n_0 = d$$ holds for every point in the plane, it is also true at point Q (the point where the vector from the origin meets the plane E), with $$\vec r = \vec r_s$$, per the definition of the Scalar product


 * $$d = \vec r_s \cdot \vec n_0 = |\vec r_s| \cdot |\vec n_0| \cdot \cos(0^\circ) = |\vec r_s| \cdot 1 = |\vec r_s|.\,$$

The magnitude $$|\vec r_s|$$ of $${\vec r_s}$$ is the shortest distance from the origin to the plane.

Distance to a line
The quadrance (distance squared) from a line $$ax + by + c = 0$$ to a point $$(x, y)$$ is


 * $$\frac{(ax+by+c)^2}{a^2 + b^2}.$$

If $$(a, b)$$ has unit length then this becomes $$(ax+by+c)^2.$$