Linear Algebra

3.3 Orthogonality

Imron Rosyadi

Linear Algebra for ECE

Orthogonality

Introduction to Orthogonality

In the previous section, we defined the “angle” between vectors using the dot product. Now, we focus on perpendicularity, a special case of the angle between vectors. Perpendicular (orthogonal) vectors are crucial in many applications, especially in ECE.

Recall the angle \(\theta\) between nonzero vectors \(\mathbf{u}\) and \(\mathbf{v}\) in \(R^n\): \[ \theta = \cos^{-1}\left(\frac{\mathbf{u}\cdot\mathbf{v}}{\|\mathbf{u}\|\|\mathbf{v}\|}\right) \] From this, \(\theta = \pi/2\) (90 degrees) if and only if \(\mathbf{u}\cdot \mathbf{v} = 0\).

Orthogonal Vectors (Definition 1)

Two nonzero vectors \(\mathbf{u}\) and \(\mathbf{v}\) in \(R^n\) are orthogonal (or perpendicular) if \(\mathbf{u}\cdot \mathbf{v} = 0\).

The zero vector \(\mathbf{0}\) is defined to be orthogonal to every vector in \(R^n\).

EXAMPLE 1: Orthogonal Vectors

  1. Show that \(\mathbf{u} = (-2,3,1,4)\) and \(\mathbf{v} = (1,2,0,-1)\) are orthogonal in \(R^4\). \[ \mathbf{u}\cdot \mathbf{v} = (-2)(1) + (3)(2) + (1)(0) + (4)(-1) = -2 + 6 + 0 - 4 = 0 \] Since \(\mathbf{u}\cdot \mathbf{v} = 0\), they are orthogonal.

  2. Show that standard unit vectors in \(R^3\) are orthogonal.

\(\mathbf{i} = (1,0,0), \mathbf{j} = (0,1,0), \mathbf{k} = (0,0,1)\)

\(\mathbf{i}\cdot \mathbf{j} = (1)(0) + (0)(1) + (0)(0) = 0\)

\(\mathbf{i}\cdot \mathbf{k} = (1)(0) + (0)(0) + (0)(1) = 0\)

\(\mathbf{j}\cdot \mathbf{k} = (0)(0) + (1)(0) + (0)(1) = 0\)

Each pair is orthogonal. This extends to \(R^n\).

Interactive Orthogonality Checker

Enter two vectors in \(R^n\) to check if they are orthogonal.

Lines and Planes Determined by Normals

A line in \(R^2\) or a plane in \(R^3\) can be uniquely defined by a point \(P_0\) and a nonzero normal vector \(\mathbf{n}\) that is orthogonal to the line/plane.

The vector equation for both cases is: \[ \mathbf{n}\cdot \overrightarrow{P_0P} = 0 \tag{1} \] where \(P\) is an arbitrary point on the line/plane.

For a line in \(R^2\):

\(P_0(x_0,y_0)\), \(\mathbf{n}=(a,b)\), \(P(x,y)\)

\(\overrightarrow{P_0P} = (x-x_0, y-y_0)\)

Point-Normal Equation: \[ a(x - x_0) + b(y - y_0) = 0 \tag{2} \]

Note

Defining Lines and Planes with Vectors. A line (in ℝ²) or a plane (in ℝ³) can be uniquely described using:

  • A point that lies on the line or plane.
  • A normal vector that is perpendicular (orthogonal) to the line or plane.

Lines and Planes Determined by Normals

For a plane in \(R^3\):

\(P_0(x_0,y_0,z_0)\), \(\mathbf{n}=(a,b,c)\), \(P(x,y,z)\)

\(\overrightarrow{P_0P} = (x-x_0, y-y_0, z-z_0)\)

Point-Normal Equation: \[ a(x - x_0) + b(y - y_0) + c(z - z_0) = 0 \tag{3} \]

Figure 3.3.1: Line in \(R^2\) and plane in \(R^3\) with normal vectors.

EXAMPLE 2: Point-Normal Equations

  • In \(R^2\), the equation \(6(x - 3) + (y + 7) = 0\) represents the line through \(P_0(3, -7)\) with normal \(\mathbf{n}=(6,1)\).
  • In \(R^3\), the equation \(4(x - 3) + 2y - 5(z - 7) = 0\) represents the plane through \(P_0(3,0,7)\) with normal \(\mathbf{n}=(4,2,-5)\).

THEOREM 3.3.1 (General Forms)

  1. A line in \(R^2\) with normal \(\mathbf{n}=(a,b)\) has equation: \[ ax + by + c = 0 \tag{4} \]
  2. A plane in \(R^3\) with normal \(\mathbf{n}=(a,b,c)\) has equation: \[ ax + by + cz + d = 0 \tag{5} \] (where \(a,b\) are not both zero, and \(a,b,c\) are not all zero, respectively)

EXAMPLE 3: Vectors Orthogonal to Lines and Planes Through the Origin

  1. The equation \(ax + by = 0\) represents a line through the origin in \(R^2\). Show that \(\mathbf{n}_1 = (a,b)\) is orthogonal to every vector along the line.

  2. The equation \(ax + by + cz = 0\) represents a plane through the origin in \(R^3\). Show that \(\mathbf{n}_2 = (a,b,c)\) is orthogonal to every vector in the plane.

Solution: Both equations can be written in the vector form: \[ \mathbf{n}\cdot \mathbf{x} = 0 \tag{6} \] where \(\mathbf{n}\) is the vector of coefficients (e.g., \((a,b)\) or \((a,b,c)\)) and \(\mathbf{x}\) is the vector of unknowns (e.g., \((x,y)\) or \((x,y,z)\)). This equation directly states that \(\mathbf{n}\) is orthogonal to any vector \(\mathbf{x}\) that satisfies the equation (i.e., lies on the line or in the plane).

Orthogonal Projections

Often, we need to decompose a vector \(\mathbf{u}\) into two components:

  1. One component (\(\mathbf{w}_1\)) that is a scalar multiple of a specified nonzero vector \(\mathbf{a}\).
  2. Another component (\(\mathbf{w}_2\)) that is orthogonal to \(\mathbf{a}\).

Visually: Drop a perpendicular from the tip of \(\mathbf{u}\) to the line containing \(\mathbf{a}\). \(\mathbf{w}_1\) is the vector from the initial point to the foot of the perpendicular. \(\mathbf{w}_2 = \mathbf{u} - \mathbf{w}_1\).

Then \(\mathbf{u} = \mathbf{w}_1 + \mathbf{w}_2\), where \(\mathbf{w}_1\) is parallel to \(\mathbf{a}\) and \(\mathbf{w}_2\) is orthogonal to \(\mathbf{a}\).

Figure 3.3.2a: Orthogonal projection where angle is acute. Figure 3.3.2b: Orthogonal projection where angle is obtuse. Figure 3.3.2c: Orthogonal projection where vectors are orthogonal.

Projection Theorem (Theorem 3.3.2)

If \(\mathbf{u}\) and \(\mathbf{a}\) are vectors in \(R^n\), and \(\mathbf{a} \neq \mathbf{0}\), then \(\mathbf{u}\) can be expressed in exactly one way as: \[ \mathbf{u} = \mathbf{w}_1 + \mathbf{w}_2 \] where \(\mathbf{w}_1\) is a scalar multiple of \(\mathbf{a}\) and \(\mathbf{w}_2\) is orthogonal to \(\mathbf{a}\).

Key Formulas:

  • The vector \(\mathbf{w}_1\) is called the orthogonal projection of \(\mathbf{u}\) on \(\mathbf{a}\), denoted \(\text{proj}_{\mathbf{a}}\mathbf{u}\). \[ \text{proj}_{\mathbf{a}}\mathbf{u} = \frac{\mathbf{u}\cdot\mathbf{a}}{\|\mathbf{a}\|^2}\mathbf{a} \tag{10} \]
  • The vector \(\mathbf{w}_2\) is the vector component of \(\mathbf{u}\) orthogonal to \(\mathbf{a}\). \[ \mathbf{w}_2 = \mathbf{u} - \text{proj}_{\mathbf{a}}\mathbf{u} \tag{11} \]

EXAMPLE 4: Orthogonal Projection on a Line

Find the orthogonal projections of \(\mathbf{e}_1=(1,0)\) and \(\mathbf{e}_2=(0,1)\) on the line \(L\) that makes an angle \(\theta\) with the positive x-axis in \(R^2\).

Let \(\mathbf{a} = (\cos \theta, \sin \theta)\) be a unit vector along line \(L\).

\(\|\mathbf{a}\| = 1\).

For \(\mathbf{e}_1=(1,0)\):

\(\mathbf{e}_1\cdot \mathbf{a} = (1,0)\cdot (\cos \theta, \sin \theta) = \cos \theta\) \[ \text{proj}_{\mathbf{a}}\mathbf{e}_1 = \frac{\mathbf{e}_1\cdot\mathbf{a}}{\|\mathbf{a}\|^2}\mathbf{a} = (\cos \theta)(\cos \theta, \sin \theta) = (\cos^2\theta, \sin \theta \cos \theta) \]

For \(\mathbf{e}_2=(0,1)\):

\(\mathbf{e}_2\cdot \mathbf{a} = (0,1)\cdot (\cos \theta, \sin \theta) = \sin \theta\) \[ \text{proj}_{\mathbf{a}}\mathbf{e}_2 = \frac{\mathbf{e}_2\cdot\mathbf{a}}{\|\mathbf{a}\|^2}\mathbf{a} = (\sin \theta)(\cos \theta, \sin \theta) = (\sin \theta \cos \theta, \sin^2\theta) \]

EXAMPLE 5: Vector Component of \(\mathbf{u}\) Along \(\mathbf{a}\)

Let \(\mathbf{u} = (2, -1, 3)\) and \(\mathbf{a} = (4, -1, 2)\). Find \(\text{proj}_{\mathbf{a}}\mathbf{u}\) and the vector component of \(\mathbf{u}\) orthogonal to \(\mathbf{a}\).

Solution:

  1. Calculate \(\mathbf{u}\cdot\mathbf{a}\): \(\mathbf{u}\cdot\mathbf{a} = (2)(4) + (-1)(-1) + (3)(2) = 8 + 1 + 6 = 15\)
  2. Calculate \(\|\mathbf{a}\|^2\): \(\|\mathbf{a}\|^2 = 4^2 + (-1)^2 + 2^2 = 16 + 1 + 4 = 21\)
  3. Calculate \(\text{proj}_{\mathbf{a}}\mathbf{u}\): \[ \text{proj}_{\mathbf{a}}\mathbf{u} = \frac{15}{21}(4, -1, 2) = \frac{5}{7}(4, -1, 2) = \left(\frac{20}{7}, -\frac{5}{7}, \frac{10}{7}\right) \]
  4. Calculate \(\mathbf{u} - \text{proj}_{\mathbf{a}}\mathbf{u}\): \[ \mathbf{u} - \text{proj}_{\mathbf{a}}\mathbf{u} = (2, -1, 3) - \left(\frac{20}{7}, -\frac{5}{7}, \frac{10}{7}\right) = \left(\frac{14-20}{7}, \frac{-7+5}{7}, \frac{21-10}{7}\right) = \left(-\frac{6}{7}, -\frac{2}{7}, \frac{11}{7}\right) \] You can verify that \(\left(-\frac{6}{7}, -\frac{2}{7}, \frac{11}{7}\right)\) is orthogonal to \((4, -1, 2)\) by checking their dot product.

Interactive Orthogonal Projection Calculator

Calculate the orthogonal projection of \(\mathbf{u}\) onto \(\mathbf{a}\).

Norm of the Orthogonal Projection

Sometimes, we’re only interested in the length of the projected vector. \[ \| \text{proj}_{\mathbf{a}}\mathbf{u}\| = \left\| \frac{\mathbf{u}\cdot\mathbf{a}}{\|\mathbf{a}\|^2}\mathbf{a}\right\| = \left|\frac{\mathbf{u}\cdot\mathbf{a}}{\|\mathbf{a}\|^2}\right|\|\mathbf{a}\| = \frac{|\mathbf{u}\cdot\mathbf{a}|}{\|\mathbf{a}\|} \tag{12} \] If \(\theta\) is the angle between \(\mathbf{u}\) and \(\mathbf{a}\), then \(\mathbf{u}\cdot\mathbf{a} = \|\mathbf{u}\|\|\mathbf{a}\|\cos\theta\). Substituting this into (12): \[ \| \text{proj}_{\mathbf{a}}\mathbf{u}\| = \frac{|\|\mathbf{u}\|\|\mathbf{a}\|\cos\theta|}{\|\mathbf{a}\|} = \|\mathbf{u}\||\cos\theta| \tag{13} \]

Figure 3.3.4: Geometric interpretation of \(\| \text{proj}_{\mathbf{a}}\mathbf{u}\|\).

The Theorem of Pythagoras in \(R^n\)

This theorem generalizes the familiar Pythagorean theorem to \(n\)-dimensional space.

Theorem 3.3.3 (Theorem of Pythagoras in \(R^n\)): If \(\mathbf{u}\) and \(\mathbf{v}\) are orthogonal vectors in \(R^n\), then: \[ \| \mathbf{u} + \mathbf{v}\|^2 = \| \mathbf{u}\|^2 + \| \mathbf{v}\|^2 \tag{14} \]

Proof: Since \(\mathbf{u}\) and \(\mathbf{v}\) are orthogonal, \(\mathbf{u}\cdot \mathbf{v} = 0\). \[ \begin{aligned} \| \mathbf{u} + \mathbf{v}\|^2 &= (\mathbf{u} + \mathbf{v})\cdot (\mathbf{u} + \mathbf{v}) \\ &= \mathbf{u}\cdot \mathbf{u} + 2(\mathbf{u}\cdot \mathbf{v}) + \mathbf{v}\cdot \mathbf{v} \\ &= \| \mathbf{u}\|^2 + 2(0) + \| \mathbf{v}\|^2 \\ &= \| \mathbf{u}\|^2 + \| \mathbf{v}\|^2 \end{aligned} \]

Figure 3.3.5: Pythagorean Theorem for orthogonal vectors.

EXAMPLE 6: Theorem of Pythagoras in \(R^4\)

Vectors \(\mathbf{u} = (-2, 3, 1, 4)\) and \(\mathbf{v} = (1, 2, 0, -1)\) are orthogonal (from Example 1). Verify the Theorem of Pythagoras for these vectors.

Solution:

  1. Calculate \(\mathbf{u} + \mathbf{v}\):

    \(\mathbf{u} + \mathbf{v} = (-2+1, 3+2, 1+0, 4-1) = (-1, 5, 1, 3)\)

  2. Calculate \(\| \mathbf{u} + \mathbf{v}\|^2\):

    \(\| \mathbf{u} + \mathbf{v}\|^2 = (-1)^2 + 5^2 + 1^2 + 3^2 = 1 + 25 + 1 + 9 = 36\)

  3. Calculate \(\| \mathbf{u}\|^2\):

    \(\| \mathbf{u}\|^2 = (-2)^2 + 3^2 + 1^2 + 4^2 = 4 + 9 + 1 + 16 = 30\)

  4. Calculate \(\| \mathbf{v}\|^2\):

    \(\| \mathbf{v}\|^2 = 1^2 + 2^2 + 0^2 + (-1)^2 = 1 + 4 + 0 + 1 = 6\)

  5. Check \(\| \mathbf{u}\|^2 + \| \mathbf{v}\|^2\):

    \(\| \mathbf{u}\|^2 + \| \mathbf{v}\|^2 = 30 + 6 = 36\)

Since \(36 = 36\), the theorem holds.

Interactive Pythagoras Verifier

Enter two vectors and verify the Theorem of Pythagoras if they are orthogonal.

Distance Problems Solved with Orthogonal Projections

Orthogonal projections can be used to solve distance problems:

  1. Distance between a point and a line in \(R^2\).
  2. Distance between a point and a plane in \(R^3\).
  3. Distance between two parallel planes in \(R^3\).

THEOREM 3.3.4 (Distance Formulas)

  1. In \(R^2\), distance \(D\) between point \(P_0(x_0,y_0)\) and line \(ax + by + c = 0\):

\[ D = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}} \tag{15} \]

  1. In \(R^3\), distance \(D\) between point \(P_0(x_0,y_0,z_0)\) and plane \(ax + by + cz + d = 0\):

\[ D = \frac{|ax_0 + by_0 + cz_0 + d|}{\sqrt{a^2 + b^2 + c^2}} \tag{16} \]

Proof of Theorem 3.3.4(b) (Point-Plane Distance)

Let \(Q(x_1,y_1,z_1)\) be any point in the plane. Let \(\mathbf{n}=(a,b,c)\) be the normal vector. The distance \(D\) is the length of the orthogonal projection of \(\overrightarrow{QP_0}\) onto \(\mathbf{n}\).

Figure 3.3.6: Geometric idea behind point-plane distance.

Proof of Theorem 3.3.4(b) (Point-Plane Distance)

Using Formula (12) for the norm of projection: \[ D = \| \text{proj}_{\mathbf{n}}\overrightarrow{QP_0}\| = \frac{|\overrightarrow{QP_0}\cdot\mathbf{n}|}{\|\mathbf{n}\|} \] Substitute \(\overrightarrow{QP_0} = (x_0 - x_1, y_0 - y_1, z_0 - z_1)\) and \(\|\mathbf{n}\| = \sqrt{a^2+b^2+c^2}\).

Since \(Q\) is in the plane, \(ax_1 + by_1 + cz_1 + d = 0 \implies d = -ax_1 - by_1 - cz_1\).

The numerator becomes \(|a(x_0 - x_1) + b(y_0 - y_1) + c(z_0 - z_1)| = |ax_0 + by_0 + cz_0 - (ax_1 + by_1 + cz_1)| = |ax_0 + by_0 + cz_0 + d|\). This yields Formula (16).

EXAMPLE 7: Distance Between a Point and a Plane

Find the distance \(D\) between the point \(P_0(1, -4, -3)\) and the plane \(2x - 3y + 6z = -1\).

Solution: First, rewrite the plane equation as \(2x - 3y + 6z + 1 = 0\).

Here, \((x_0,y_0,z_0) = (1,-4,-3)\) and \((a,b,c,d) = (2,-3,6,1)\).

Using Formula (16): \[ D = \frac{|2(1) + (-3)(-4) + 6(-3) + 1|}{\sqrt{2^2 + (-3)^2 + 6^2}} = \frac{|2 + 12 - 18 + 1|}{\sqrt{4 + 9 + 36}} = \frac{|-3|}{\sqrt{49}} = \frac{3}{7} \]

Interactive Point-Plane Distance Calculator

Calculate the distance between a point and a plane in \(R^3\).

Distance Between Parallel Planes

To find the distance between two parallel planes in \(R^3\):

  1. Find any point \(P_0\) in one of the planes.
  2. Compute the distance between \(P_0\) and the other plane using Formula (16).

Figure 3.3.7: Distance between parallel planes.

Distance Between Parallel Planes

EXAMPLE 8: Distance Between Parallel Planes

Find the distance between:

Plane 1: \(x + 2y - 2z = 3\)

Plane 2: \(2x + 4y - 4z = 7\)

Solution: Normals are \((1, 2, -2)\) and \((2, 4, -4)\), which are parallel (one is twice the other).

  1. Find a point in Plane 1: Set \(y=0, z=0 \implies x=3\). So, \(P_0(3,0,0)\) is in Plane 1.

  2. Compute distance from \(P_0(3,0,0)\) to Plane 2 (\(2x + 4y - 4z - 7 = 0\)).

    Here, \((x_0,y_0,z_0) = (3,0,0)\) and \((a,b,c,d) = (2,4,-4,-7)\).

    \[ D = \frac{|2(3) + 4(0) + (-4)(0) - 7|}{\sqrt{2^2 + 4^2 + (-4)^2}} = \frac{|6 - 7|}{\sqrt{4 + 16 + 16}} = \frac{|-1|}{\sqrt{36}} = \frac{1}{6} \]

Interactive Parallel Plane Distance Calculator

Calculate the distance between two parallel planes in \(R^3\).

Summary and Key Takeaways

  • Orthogonal Vectors: Vectors whose dot product is zero, representing perpendicularity.
  • Normal Vectors: Define orientation of lines (in \(R^2\)) and planes (in \(R^3\)).
  • Orthogonal Projection: Decomposing a vector into components parallel and orthogonal to another vector.
    • \(\text{proj}_{\mathbf{a}}\mathbf{u} = \frac{\mathbf{u}\cdot\mathbf{a}}{\|\mathbf{a}\|^2}\mathbf{a}\)
  • Pythagoras Theorem: Extends to \(R^n\) for orthogonal vectors: \(\| \mathbf{u} + \mathbf{v}\|^2 = \| \mathbf{u}\|^2 + \| \mathbf{v}\|^2\).
  • Distance Formulas: Efficiently calculate distances between points, lines, and planes using normal vectors and projections.

Summary and Key Takeaways

Applications in ECE:

  • Signal Processing: Orthogonal bases (e.g., Fourier, Wavelets) for signal decomposition and analysis.
  • Control Systems: State-space analysis, defining constraint surfaces.
  • Computer Graphics: Lighting, camera transformations, collision detection.
  • Machine Learning: Principal Component Analysis (PCA) uses orthogonal projections to reduce dimensionality.