Lab 10 Interactive: Inner Products, Projection, QR, and Adjoints

Explore how an inner product creates geometry: length, angle, orthogonality, projection, QR factorization, least squares, and adjoints.

1. Inner product and angle in $\mathbb R^3$

Enter two vectors. The tool computes $x\cdot y$, norms, and the angle.

$x$

$y$

2. Projection onto a line in the plane

Orange is $y$. Blue is the line $L=\operatorname{span}\{w\}$. Black is $\operatorname{proj}_L(y)$. Red is the residual.

3. Gram--Schmidt and QR

Enter a $3\times2$ matrix $A=[b_1\ b_2]$. The tool computes an orthonormal basis and $A=QR$.

4. Least squares by QR

Fit $b\approx c_0+c_1t$ using four data points. This is projection onto the column space of $A=[1\ t]$.

5. Orthogonal matrix test

A matrix is orthogonal when $U^TU=I$. Orthogonal matrices preserve lengths and angles.

6. Complex adjoint

For complex matrices, the adjoint is $A^*=\overline A^T$, not just $A^T$.

Use entries $a+bi$.

7. Independent-study practice tasks with answers

Task A. For $x=(1,2,-1)$ and $y=(3,0,4)$, compute the angle.
Answer: $x\cdot y=-1$, $\|x\|=\sqrt6$, $\|y\|=5$, so $\cos\theta=-1/(5\sqrt6)$.
Task B. Project $y=(4,1,2)$ onto $\operatorname{span}\{(1,2,0)\}$.
Answer: The projection is $(6/5,12/5,0)$ and the residual is $(14/5,-7/5,2)$.
Task C. Apply Gram--Schmidt to $(1,1,1)$ and $(1,0,1)$.
Answer: An orthonormal basis is $(1,1,1)/\sqrt3$ and $(1,-2,1)/\sqrt6$.
Task D. Why is QR preferred for least squares?
Answer: QR avoids explicitly forming $A^TA$, which squares the condition number and can magnify numerical errors.
Task E. Compute $A^*$ for $A=\begin{bmatrix}1&i\\2&1-i\end{bmatrix}$.
Answer: $A^*=\begin{bmatrix}1&2\\-i&1+i\end{bmatrix}$.

8. Workspace