3 PROJECTION ON A LINE

3.1. Definition

Consider the line in \mathbb{R}^n passing through x_0 \in \mathbb{R}^n and with direction u \in \mathbb{R}^n:

    \begin{align*} \{x_0 + tu: t \in \mathbb{R}\} \end{align*}

Example 1: A line in \mathbb{R}^2 passing through the point x_0 = (0,1), with direction u=(0.8944, 0.4472).

The projection of a given point x on the line is a vector z located on the line, that is closest to x (in Euclidean norm). This corresponds to a simple optimization problem:

    \begin{align*} \min\limits_{t} ||x-(x_0+tu)||_2 \end{align*}

This particular problem is part of a general class of optimization problems known as least-squares. It is also a special case of a Euclidean projection on a general set.

Example 2: Projection of the vector x=(1.6, 2.28) on a line passing through the origin (x_0 = 0) and with (normalized) direction u = (0.8944, 0.4472).
At optimality the ‘‘residual’’ vector x-z is orthogonal to the line, hence z = tu, with t = x^Tu = 2.0035. Any other point on the line is farther away from the point x than its projection z is.
The scalar t = u^T x, ie the scalar product between x and u, is the component of x along the normalized direction u.

3.2. Closed-form expression

Assuming that u is normalized, so that ||u||_2=1, the objective function of the projection problem reads, after squaring:

    \begin{align*} ||x-x_0-tu||_2^2 = t^2 - 2tu^T(x-x_0) + ||x-x_0||_2^2 = (t-u^T(x-x_0))^2 + \text{{constant}} \end{align*}

Thus, the optimal solution to the projection problem is

    \begin{align*} t^* = u^T(x-x_0) \end{align*}

and the expression for the projected vector is

    \begin{align*} z^* = x_0 + t^*u = x_0 + u^T(x-x_0)u \end{align*}

The scalar product u^T(x-x_0) is the component of x-x_0  along u.

In the case when u is not normalized, the expression is obtained by replacing u with its scaled version u/||u||_2 :

    \begin{align*} z^* = x_0 + t^*u = x_0 + \frac{u^T(x-x_0)}{u^T u}u \end{align*}

3.3. Interpreting the scalar product

We can now interpret the scalar product between two non-zero vectors x, u, by applying the previous derivation to the projection of x on the line {\bf L} of direction u passing through the origin. If u is normalized (||u||_2 = 1), then the projection of x on {\bf L} is z^* = (u^T x)u. Its length is ||z^*||_2 = |u^Tx|. (See above figure from Example 2.)

In general, the scalar product u^T x is simply the component of x along the normalized direction u/||u||_2 defined by u.

License

Icon for the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License

Linear Algebra and Applications Copyright © 2023 by VinUiversity is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, except where otherwise noted.

Share This Book