Tutorials › Linear Algebra › Computing Orthonormal Coordinates in Rn

Orthogonal Sets and Gram-Schmidt · Tutorial 635 of 1000

Computing Orthonormal Coordinates in Rn

Use inner products or an orthogonal basis matrix to find coordinates in \(\mathbb{R}^n\), then reconstruct and verify the original vector.

Intermediate 10 min read

What You'll Learn

  • Identify the difference between standard coordinates and coordinates relative to an orthonormal basis.
  • Compute each basis coordinate using an inner product.
  • Use a basis matrix and its transpose to calculate coordinates efficiently.
  • Reconstruct a vector from a given coordinate list.
  • Check coordinate calculations by taking inner products and rebuilding the vector.
  • Avoid confusing multiplication by a basis matrix with multiplication by its transpose.

Coordinates Depend on the Basis

A vector in \(\mathbb{R}^n\) has standard coordinates: its entries give its components along the standard basis vectors \(\mathbf{e}_1,\dots,\mathbf{e}_n\). A different basis describes the same vector using different coefficients. When the basis is orthonormal, those coefficients can be computed directly by inner products, and the vector can be reconstructed by adding the corresponding multiples of the basis vectors. This tutorial focuses on carrying out both calculations accurately.

Throughout, \(\mathbb{R}^n\) has the standard dot product \(\mathbf{x}\cdot\mathbf{y}=\mathbf{x}^{\top}\mathbf{y}\). An ordered list \(\mathcal{B}=(\mathbf{q}_1,\dots,\mathbf{q}_n)\) is an orthonormal basis of \(\mathbb{R}^n\) when it is a basis and satisfies \(\mathbf{q}_i\cdot\mathbf{q}_j=1\) for \(i=j\) and \(0\) for \(i\ne j\). The coordinate vector \([\mathbf{x}]_{\mathcal{B}}\) is the column of coefficients \(c_1,\dots,c_n\) in the unique expression \(\mathbf{x}=c_1\mathbf{q}_1+\cdots+c_n\mathbf{q}_n\). In general, these coefficients are not the entries of \(\mathbf{x}\) in standard coordinates.

Theorem (Coordinates in an orthonormal basis): Let \(\mathcal{B}=(\mathbf{q}_1,\dots,\mathbf{q}_n)\) be an orthonormal basis of \(\mathbb{R}^n\). For every \(\mathbf{x}\in\mathbb{R}^n\), its \(i\)-th coordinate is \(c_i=\mathbf{q}_i\cdot\mathbf{x}\), and \[ [\mathbf{x}]_{\mathcal{B}}= \begin{bmatrix} \mathbf{q}_1\cdot\mathbf{x}\\ \vdots\\ \mathbf{q}_n\cdot\mathbf{x} \end{bmatrix}, \qquad \mathbf{x}=\sum_{i=1}^{n}(\mathbf{q}_i\cdot\mathbf{x})\mathbf{q}_i. \]

Proof. Because \(\mathcal{B}\) is a basis, there are unique coefficients \(c_1,\dots,c_n\) such that \(\mathbf{x}=\sum_{j=1}^{n}c_j\mathbf{q}_j\). Fix an index \(i\) and take the dot product with \(\mathbf{q}_i\). Bilinearity gives \(\mathbf{q}_i\cdot\mathbf{x}=\sum_{j=1}^{n}c_j(\mathbf{q}_i\cdot\mathbf{q}_j)\). Orthonormality makes every term zero except the term \(j=i\), which is \(c_i(\mathbf{q}_i\cdot\mathbf{q}_i)=c_i\). Therefore \(c_i=\mathbf{q}_i\cdot\mathbf{x}\). Substituting these coefficients into the basis expansion gives the displayed coordinate vector and reconstruction formula. \(\square\)

The theorem provides a direct procedure: take one dot product per basis vector, place the results in the same order as the basis list, and use those coefficients to reconstruct the vector. The order matters. Swapping two basis vectors swaps the corresponding entries of the coordinate vector as well.

Worked Coordinates in a Nonstandard Basis

Worked Example: A Rotated Basis in R²

Let \(\mathcal{B}=(\mathbf{q}_1,\mathbf{q}_2)\), where \(\mathbf{q}_1=\tfrac{1}{\sqrt{2}}(1,1)\) and \(\mathbf{q}_2=\tfrac{1}{\sqrt{2}}(-1,1)\). Find the coordinates of \(\mathbf{x}=(3,1)\), and reconstruct \(\mathbf{x}\) from them.

First check the basis vectors: \(\mathbf{q}_1\cdot\mathbf{q}_1=(1+1)/2=1\), \(\mathbf{q}_2\cdot\mathbf{q}_2=(1+1)/2=1\), and \(\mathbf{q}_1\cdot\mathbf{q}_2=(-1+1)/2=0\). They are an orthonormal list of two vectors in \(\mathbb{R}^2\), and they are independent: if \(a\mathbf{q}_1+b\mathbf{q}_2=\mathbf{0}\), taking dot products with \(\mathbf{q}_1\) and \(\mathbf{q}_2\) gives \(a=0\) and \(b=0\). Thus they form a basis.

Take the two inner products in the order of the basis:

$$ \mathbf{q}_1\cdot\mathbf{x} =\frac{3+1}{\sqrt{2}}=2\sqrt{2}, \qquad \mathbf{q}_2\cdot\mathbf{x} =\frac{-3+1}{\sqrt{2}}=-\sqrt{2}. $$

Therefore \([\mathbf{x}]_{\mathcal{B}}=(2\sqrt{2},-\sqrt{2})^{\top}\). Reconstruct using those coefficients:

$$ 2\sqrt{2}\,\mathbf{q}_1-\sqrt{2}\,\mathbf{q}_2 =(2,2)-(-1,1) =(3,1). $$

Check: the reconstructed vector is exactly the given \(\mathbf{x}\). The coordinate list \((2\sqrt{2},-\sqrt{2})^{\top}\) is not the standard-coordinate column \((3,1)^{\top}\); it records coefficients along \(\mathbf{q}_1,\mathbf{q}_2\).

The Basis-Matrix Calculation

For an orthonormal basis, place its vectors as the columns of a matrix: \(\mathbf{Q}=\begin{bmatrix}\mathbf{q}_1&\cdots&\mathbf{q}_n\end{bmatrix}\). Then \(\mathbf{Q}\mathbf{c}\) forms the linear combination of the columns with coefficient column \(\mathbf{c}\). The transpose \(\mathbf{Q}^{\top}\) places the inner products with those columns into a column. This gives a compact version of the coordinate theorem.

Proposition: If the columns of \(\mathbf{Q}\in\mathbb{R}^{n\times n}\) form an orthonormal basis, then \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\), \(\mathbf{Q}\mathbf{Q}^{\top}=\mathbf{I}_n\), and, for every \(\mathbf{x}\in\mathbb{R}^n\), \[ [\mathbf{x}]_{\mathcal{B}}=\mathbf{Q}^{\top}\mathbf{x}, \qquad \mathbf{x}=\mathbf{Q}[\mathbf{x}]_{\mathcal{B}}. \]

Proof. The entry in row \(i\), column \(j\) of \(\mathbf{Q}^{\top}\mathbf{Q}\) is \(\mathbf{q}_i\cdot\mathbf{q}_j\). It equals \(1\) when \(i=j\) and \(0\) otherwise, so \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\). The \(i\)-th entry of \(\mathbf{Q}^{\top}\mathbf{x}\) is \(\mathbf{q}_i\cdot\mathbf{x}\), which the coordinate theorem identifies as the \(i\)-th coordinate. Hence \(\mathbf{Q}^{\top}\mathbf{x}=[\mathbf{x}]_{\mathcal{B}}\), and the reconstruction formula gives \(\mathbf{x}=\mathbf{Q}[\mathbf{x}]_{\mathcal{B}}\). To establish the other matrix identity, apply \(\mathbf{Q}\mathbf{Q}^{\top}\) to any \(\mathbf{x}\). The formulas just proved give \(\mathbf{Q}\mathbf{Q}^{\top}\mathbf{x}=\mathbf{Q}[\mathbf{x}]_{\mathcal{B}}=\mathbf{x}\). Since this holds for every column \(\mathbf{x}\in\mathbb{R}^n\), the matrix acts as the identity on every standard basis vector and therefore equals \(\mathbf{I}_n\). Thus \(\mathbf{Q}\mathbf{Q}^{\top}=\mathbf{I}_n\). \(\square\)

Both matrix identities are useful checks on an orthonormal basis matrix. They also explain why the transpose appears in the coordinate calculation: \(\mathbf{Q}^{\top}\mathbf{x}\) extracts coefficients, whereas \(\mathbf{Q}\) uses those coefficients to rebuild the vector.

Worked Example: Coordinates in R³ by Matrix Multiplication

Use the ordered list \(\mathcal{B}=(\mathbf{q}_1,\mathbf{q}_2,\mathbf{q}_3)\), where \(\mathbf{q}_1=(1,1,1)^{\top}/\sqrt{3}\), \(\mathbf{q}_2=(1,-1,0)^{\top}/\sqrt{2}\), and \(\mathbf{q}_3=(1,1,-2)^{\top}/\sqrt{6}\). Find the coordinates of \(\mathbf{x}=(2,-1,4)^{\top}\), then reconstruct it.

Each vector has norm \(1\): the squared lengths of the unnormalized columns are \(3,2,6\), respectively. Their pairwise dot products before normalization are \(1-1+0=0\), \(1+1-2=0\), and \(1-1+0=0\), so the list is orthonormal. Form the basis matrix and its transpose:

$$ \mathbf{Q}= \begin{bmatrix} 1/\sqrt{3}&1/\sqrt{2}&1/\sqrt{6}\\ 1/\sqrt{3}&-1/\sqrt{2}&1/\sqrt{6}\\ 1/\sqrt{3}&0&-2/\sqrt{6} \end{bmatrix}, \qquad \mathbf{Q}^{\top}\mathbf{x} = \begin{bmatrix} (2-1+4)/\sqrt{3}\\ (2+1)/\sqrt{2}\\ (2-1-8)/\sqrt{6} \end{bmatrix} = \begin{bmatrix} 5/\sqrt{3}\\ 3/\sqrt{2}\\ -7/\sqrt{6} \end{bmatrix}. $$

Thus the coordinate vector is \((5/\sqrt{3},3/\sqrt{2},-7/\sqrt{6})^{\top}\). Reconstruct by multiplying each coefficient by its matching basis vector:

$$ \frac{5}{\sqrt{3}}\mathbf{q}_1= \begin{bmatrix}5/3\\5/3\\5/3\end{bmatrix}, \qquad \frac{3}{\sqrt{2}}\mathbf{q}_2= \begin{bmatrix}3/2\\-3/2\\0\end{bmatrix}, \qquad -\frac{7}{\sqrt{6}}\mathbf{q}_3= \begin{bmatrix}-7/6\\-7/6\\7/3\end{bmatrix}. $$

Adding the first entries gives \(5/3+3/2-7/6=10/6+9/6-7/6=2\). The second entries give \(5/3-3/2-7/6=10/6-9/6-7/6=-1\). The third entries give \(5/3+0+7/3=4\). Therefore reconstruction returns \((2,-1,4)^{\top}\), as required.

Reconstructing from a Coordinate List

The direction of the calculation can start with coordinates instead of a vector. Given \(\mathbf{c}=(c_1,\dots,c_n)^{\top}\), the vector it represents in \(\mathcal{B}\) is \(\mathbf{x}=\mathbf{Q}\mathbf{c}=\sum_{i=1}^{n}c_i\mathbf{q}_i\). After reconstructing, one can verify that the coordinates really were the entries of \(\mathbf{c}\): for each \(j\), \(\mathbf{q}_j\cdot\mathbf{x}=\sum_{i=1}^{n}c_i(\mathbf{q}_j\cdot\mathbf{q}_i)=c_j\). The orthonormality removes all terms except the \(i=j\) term.

Worked Example: Rebuilding a Vector from Its Coordinates

Let \(\mathcal{B}=(\mathbf{q}_1,\mathbf{q}_2,\mathbf{q}_3)\), where \(\mathbf{q}_1=(0,1,0)^{\top}\), \(\mathbf{q}_2=(1,0,1)^{\top}/\sqrt{2}\), and \(\mathbf{q}_3=(1,0,-1)^{\top}/\sqrt{2}\). Reconstruct the vector with coordinate column \(\mathbf{c}=(2,-\sqrt{2},3\sqrt{2})^{\top}\).

The vectors have squared lengths \(1,(1+1)/2,(1+1)/2\), all equal to \(1\). The first is orthogonal to both others, and \(\mathbf{q}_2\cdot\mathbf{q}_3=(1-1)/2=0\). Thus the list is orthonormal. Compute the linear combination:

$$ \mathbf{x} =2\mathbf{q}_1-\sqrt{2}\,\mathbf{q}_2+3\sqrt{2}\,\mathbf{q}_3 = \begin{bmatrix}0\\2\\0\end{bmatrix} + \begin{bmatrix}-1\\0\\-1\end{bmatrix} + \begin{bmatrix}3\\0\\-3\end{bmatrix} = \begin{bmatrix}2\\2\\-4\end{bmatrix}. $$

Check: taking dot products with the ordered basis gives \(\mathbf{q}_1\cdot\mathbf{x}=2\), \(\mathbf{q}_2\cdot\mathbf{x}=(2-4)/\sqrt{2}=-\sqrt{2}\), and \(\mathbf{q}_3\cdot\mathbf{x}=(2+4)/\sqrt{2}=3\sqrt{2}\). These are exactly the entries of the given coordinate column.

A Useful Consistency Check

For any two vectors \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\), orthonormal coordinates also preserve dot products: \[ \mathbf{x}\cdot\mathbf{y} =[\mathbf{x}]_{\mathcal{B}}^{\top}[\mathbf{y}]_{\mathcal{B}}. \] Indeed, writing each vector as a sum of its basis components gives \(\mathbf{x}\cdot\mathbf{y}=\sum_i\sum_j c_i d_j(\mathbf{q}_i\cdot\mathbf{q}_j)=\sum_i c_i d_i\), where \(c_i\) and \(d_i\) are the respective coordinates. This is the coordinate form of Parseval's identity. In particular, the squared length is the sum of the squares of the coordinates. It is a useful check, but it does not replace checking the signs and order of the individual coefficients.

Common mistake: multiplying in the wrong order. In the first example, the basis matrix is \(\mathbf{Q}=\tfrac{1}{\sqrt{2}}\begin{bmatrix}1&-1\\1&1\end{bmatrix}\). A tempting but wrong calculation is to find coordinates as \(\mathbf{Q}\mathbf{x}\), which gives \(\tfrac{1}{\sqrt{2}}(2,4)^{\top}=(\sqrt{2},2\sqrt{2})^{\top}\). Those are not the coordinates: the columns of \(\mathbf{Q}\) are the basis vectors, so coordinates are found with the transpose: \[ \mathbf{Q}^{\top}\mathbf{x} =\frac{1}{\sqrt{2}} \begin{bmatrix}1&1\\-1&1\end{bmatrix} \begin{bmatrix}3\\1\end{bmatrix} = \begin{bmatrix}2\sqrt{2}\\-\sqrt{2}\end{bmatrix}. \] Multiplying this correct coordinate column by \(\mathbf{Q}\) reconstructs \((3,1)^{\top}\). Keep the roles distinct: transpose to extract coordinates, basis matrix to reconstruct.

Check Your Understanding

For each calculation, keep the basis order fixed and verify by taking dot products or reconstructing the vector.

  1. For \(\mathbf{q}_1=(1,1)^{\top}/\sqrt{2}\), \(\mathbf{q}_2=(1,-1)^{\top}/\sqrt{2}\), find the coordinates of \((4,2)^{\top}\).
  2. Using the basis in Question 1, reconstruct the vector with coordinates \((3\sqrt{2},\sqrt{2})^{\top}\).
  3. For the basis in the second worked example, compute the coordinates of \((1,2,0)^{\top}\).
  4. If \(\mathbf{Q}\) has an orthonormal basis as its columns, which product extracts coordinates: \(\mathbf{Q}\mathbf{x}\) or \(\mathbf{Q}^{\top}\mathbf{x}\)? Explain the role of each matrix product.
  5. Show directly from orthonormality that \(\mathbf{q}_j\cdot\sum_{i=1}^{n}c_i\mathbf{q}_i=c_j\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon