Vectors: Distance, angle, dot product and cross product
Normal vector in ℝ²
Orthogonality of vectors is an excellent means to describe a line in \(\mathbb{R}^2\) or a plane in \(\mathbb{R}^3\).
Normal vector to a line For fixed vectors \(\vec{n}=\cv{n_1\\n_2}\) and \(\vec{a}=\cv{a_1\\a_2}\) with \(\vec{a}\neq\vec{0}\), the equation\[\ell : \, \vec{n}\boldsymbol{\cdot} \vec{x}= \vec{n}\boldsymbol{\cdot} \vec{a}\] or, elaborated in coordinates, \[n_1x_1+n_2x_2=n_1a_1+n_2a_2\] represents a straight line \(\ell\). This line passes through the terminal point of the vector \(\vec{a}\). We call this a normal equation of the line.
The reason for this naming is that we can also write to this equation as \[\vec{n}\boldsymbol{\cdot}\left(\vec{x}-\vec{a}\right)=0\] The vectors \(\vec{n}\) and \(\vec{x}-\vec{a}\) are thus perpendicular. The vector \(\vec{x}-\vec{a}\) is the arrow from the terminal point of \(\vec{a}\) to the terminal point \(\vec{x}\) and is for each \(\vec{x}\neq\vec{a}\) an arrow along \(\ell\). In other words, the vector \(\vec{n}\) is perpendicular to the line \(\ell\) and is therefore referred to as a normal vector to the line.
A normal vector is unique up to a scalar multiple.
(Multiples of this equation are correct as well).
A vector representation of \(\ell\) is \[\cv{x\\y} = \cv{4\\1} + \lambda \cv{9 \\ 0}\tiny.\] The vector \(\cv{ 0\\9 }\) is perpendicular to \(\cv{9 \\ 0}\) because their dot product is equal to zero. To find this vector one can exchange the two components of the original vector and then to change the sign of one of them. We van use this vector as normal vector of the line \(\ell\).
We get: \[ \begin{aligned}\cv{x\\y} &= \cv{4\\1} + \lambda \cv{9 \\ 0}\\
&\phantom{abcdwxyz}\blue{\text{vector representation of }\ell}\\[0.1cm]
\cv{x\\y} \cdot \cv{ 0\\9 } &= \cv{4\\1}\cdot \cv{ 0\\9 } + \lambda \cv{9 \\ 0}\cdot \cv{ 0\\9 } \\
&\phantom{abcdwxyz}\blue{\text{on the left- and right-hand side, the dot product with }\cv{ 0\\9 }}\\[0.1cm]
\cv{x\\y} \cdot \cv{0\\9 } &= \cv{4\\1}\cdot \cv{ 0\\9 } + \lambda\cdot 0\\
&\phantom{abcdwxyz}\blue{\text{simplification with orthogonal vectors}}\\
9 y &= 9\\
&\phantom{abcdwxyz}{\blue{\text{computation of dot products}}}
\\ y &= 1\\ &\phantom{abcdwxyz}\blue{\text{simplification}}\end{aligned}\] So, an equation of the line \(\ell\) is \[0 x + 9 y = 9.
\]
Formulas for distance Two lines \(\ell\) and \(m\) in \(\mathbb{R}^2\) with the same normal vector \(\vec{n}\) are parallel or coinciding lines. If \(\vec{a}\) is a vector with the terminal point on \(\ell\) and \(\vec{b}\) is a vector with the terminal point on \(m\), then the distance \(d(\ell,m)\) between the two lines can be calculated via the formula \[d(\ell,m)=\frac{\left|\vec{n}\boldsymbol{\cdot} \vec{a}-\vec{n}\boldsymbol{\cdot} \vec{b}\right|}{\lVert\vec{n}\rVert}\] The same formula also gives the shortest distance from the terminal point of \(\vec{b}\) to the line \(\ell\) : \[d(\ell,\vec{b})=\frac{\left|\vec{n}\boldsymbol{\cdot} \vec{a}-\vec{n}\boldsymbol{\cdot} \vec{b}\right|}{\lVert\vec{n}\rVert}\]