Understand Linear Algebra Through Geometry, Relationships, and Change

Explore vector spaces, linear combinations, 2D matrix transformations, determinants, eigenvectors, Gram-Schmidt orthogonalization, and Singular Value Decomposition (SVD) with real-time interactive canvases, bilingual explanations, and IPA.

6 Core Modules
6 2D Live Canvases
15 Practice Questions
Module 1

Vectors, Linear Combinations, Span & Independence

Understand how vectors add, scale, and span 2D space, and visualize when vectors become linearly dependent.

Vectors & Linear Combinations

  • Vector (向量): /ˈvektər/ An object with magnitude and direction, represented as an arrow in space.
    $$\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} = c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2$$
  • Linear Combination (线性组合): /ˈlɪniər ˌkɒmbɪˈneɪʃn/ Sum of scalar multiples of vectors: $c_1 \mathbf{u} + c_2 \mathbf{v}$.

Span & Linear Independence

  • Span (张成空间): /spæn/ The set of all possible linear combinations formed by a set of vectors.
    $$\text{Span}(\mathbf{u}, \mathbf{v}) = \{ c_1 \mathbf{u} + c_2 \mathbf{v} \mid c_1, c_2 \in \mathbb{R} \}$$
  • Linear Independence (线性无关): /ˈlɪniər ˌɪndɪˈpendəns/ No vector in the set can be written as a linear combination of the others ($c_1 \mathbf{u} + c_2 \mathbf{v} = \mathbf{0} \implies c_1 = c_2 = 0$).

Subspace, Basis & Dimension

  • Subspace (子空间): /ˈsʌbˌspeɪs/ A subset $W \subseteq V$ containing $\mathbf{0}$, closed under vector addition and scalar multiplication.
  • Basis & Dimension (基与维度): /ˈbeɪsɪs/ /daɪˈmenʃn/ A basis is a linearly independent set that spans the space. Dimension is the number of basis vectors.
    $$\dim(\mathbb{R}^2) = 2, \quad \mathbf{e}_1 = \begin{bmatrix}1\\0\end{bmatrix}, \mathbf{e}_2 = \begin{bmatrix}0\\1\end{bmatrix}$$

2D Vector Span & Linear Independence Simulator

Drag vector arrowheads directly on the canvas or adjust sliders to see if their Span covers $\mathbb{R}^2$ or collapses into a line!

Span = 2D Plane (Linearly Independent)
$u_x$: 2.0
$u_y$: 1.0
$v_x$: -1.0
$v_y$: 2.0
$c_1$: 1.0
$c_2$: 1.0
$c_1 \mathbf{u} + c_2 \mathbf{v} =$: [1.00, 3.00]
$\det([\mathbf{u}\ \mathbf{v}]) =$: 5.00
Vectors are Linearly Independent: $\det \neq 0$, Span is the full 2D plane ($\mathbb{R}^2$).
💡 Drag vector tips on canvas
Module 2

Matrices as Linear Transformations & Determinants

Visualize how a 2x2 matrix moves, skews, and rotates space, and discover why Determinant equals area scaling factor.

Linear Transformations

  • Linear Transformation (线性变换): /ˈlɪniər ˌtrænsfərˈmeɪʃn/ A mapping that preserves grid lines (lines remain lines, origin remains fixed).
    $$T(\mathbf{x}) = A\mathbf{x} = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}$$
  • Columns of Matrix = Transformed Basis Vectors: Column 1 is $T(\hat{i})$, Column 2 is $T(\hat{j})$.

Determinant, Rank & Nullspace

  • Determinant (行列式): /dɪˈtɜːrmɪnənt/ The factor by which a transformation scales areas ($\det(A) = ad - bc$).
    $$\det(A) = ad - bc$$
  • Rank & Nullspace (秩与零空间): /ræŋk/ /ˈnʌlspeɪs/ Rank is the dimension of output space; Nullspace is all vectors that land on origin ($\mathbf{0}$).

Composition & Inverse Matrix

  • Matrix Composition (矩阵乘法与复合变换): Multiplying $BA$ applies transformation $A$ first, then $B$. Note $BA \neq AB$ (non-commutative).
  • Inverse Matrix (逆矩阵): /ˈɪnvɜːrs/ Undoes the transformation. Exists iff $\det(A) \neq 0$:
    $$A^{-1} = \frac{1}{ad-bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$$

2D Matrix Transformation & Determinant Explorer

Adjust matrix parameters or click presets to view coordinate grid warping and unit square transformation into a parallelogram.

Invertible (Det ≠ 0)
$\det(A) = ad - bc =$: 1.80
$\text{Trace}(A) = a + d =$: 2.70
$\text{Rank}(A) =$: 2
Transformation is orientation-preserving: $\det(A) > 0$. Area is scaled by 1.80x.

Matrix Composition Lab: See Multiplication as Two Transformations

Set two independent 2×2 matrices, then compare the geometric stages of applying them in either order.

A → B = BA
Current product: BA = [[1, 1], [-1, 0]]
Read from right to left: A acts first, then B.

Row × Column Derivation

Each result entry is one row of the left matrix dotted with one column of the right matrix.

BA = B × A

2D Inverse Transformation & Invertibility Lab

Apply a matrix, then test whether a unique inverse can restore the plane and the unit square.

Invertible (det = 1)
Determinant: det(A) = 1
Apply A, then A⁻¹; the composition returns to the identity I.

Inverse Formula & Verification

A⁻¹ = 1 / det(A) · [[d, −b], [−c, a]]

Adjugate part[[d, −b], [−c, a]] = [[0, 1], [−1, 0]]
Inverse matrixA⁻¹ = [[0, 1], [−1, 0]]

AA⁻¹ = [[1, 0], [0, 1]]; A⁻¹A = [[1, 0], [0, 1]]

The inverse returns the unit square to its original position.

Module 3

Linear Systems, Rank & Gaussian Elimination

Use 2D lines, augmented matrices, and row operations to distinguish unique, no, and infinitely many solutions.

Geometry of Linear Systems

Each two-variable linear equation is a line; their intersection satisfies both equations.

Gauss-Jordan Elimination

Use row swaps, scaling, and replacement to reduce an augmented matrix to RREF.

Rank & Solution Classification

Different ranks for A and [A|b] mean no solution; equal ranks give a unique solution only when they match the number of unknowns.

2×2 Linear Systems & RREF Laboratory

Change coefficients and follow how lines, the augmented matrix, and row operations determine the solution type.

Unique Solution
Equations:
Current Augmented Matrix:

Current Row Operation:

rank(A):2
rank([A|b]):2
Module 4

Eigenvalues, Eigenvectors & Diagonalization

Discover vectors that do not change direction during transformation ($A\mathbf{v} = \lambda \mathbf{v}$) and explore spectral decomposition.

Eigenvalues & Eigenvectors

  • Eigenvalue & Eigenvector (特征值与特征向量): /ˈaɪɡənˌvæljuː/ /ˈaɪɡənˌvektər/ A non-zero vector $\mathbf{v}$ is an eigenvector if $A\mathbf{v}$ is a scalar multiple of $\mathbf{v}$.
    $$A\mathbf{v} = \lambda \mathbf{v} \iff (A - \lambda I)\mathbf{v} = \mathbf{0}$$
  • Characteristic Equation (特征方程): $\det(A - \lambda I) = 0 \implies \lambda^2 - \text{tr}(A)\lambda + \det(A) = 0$.

Diagonalization & Spectral Theorem

  • Diagonalization (对角化): /daɪˈæɡənəlaɪˌzeɪʃn/ Factoring matrix $A$ into eigenvector basis $P$ and diagonal matrix $D$: $A = PDP^{-1}$.
    $$A = P D P^{-1}, \quad A^n = P D^n P^{-1}$$
  • Spectral Theorem (谱定理): Every real symmetric matrix ($A = A^T$) can be orthogonally diagonalized ($A = Q D Q^T$) with real eigenvalues.

Multiplicity & PCA Connection

  • Algebraic vs Geometric Multiplicity: Algebraic is root multiplicity in characteristic eq; Geometric is dimension of eigenspace $\text{Null}(A-\lambda I)$.
  • PCA & Covariance Matrix (主成分分析): Principal components are eigenvectors of covariance matrix $C = \frac{1}{n} X^T X$, pointing in directions of max variance.

Eigenvector & Eigenvalue Interactive Probe

Rotate probe vector $\mathbf{x}$ using slider or trigger Auto-Sweep. When $\mathbf{x}$ and $A\mathbf{x}$ align along the exact same line, you found an Eigenvector!

Scanning Probe Angle...
32°
Eigenvalue $\lambda_1 =$: 3.62
Eigenvalue $\lambda_2 =$: 1.38
Collinearity Angle Error: 14.2°
Probe $\mathbf{x}$ is not aligned with $A\mathbf{x}$. Keep rotating to align!
Module 5

Orthogonality, Projection, QR, PCA & SVD

Master the geometry of orthogonal projection, QR, least squares, PCA dimensionality reduction, and Singular Value Decomposition.

Dot Product & Projection

  • Dot Product & Orthogonality (点积与正交性): /ɔːrˌθɒɡəˈnæləti/ Vectors $\mathbf{u}, \mathbf{v}$ are orthogonal ($\mathbf{u} \perp \mathbf{v}$) iff $\mathbf{u} \cdot \mathbf{v} = 0$.
    $$\mathbf{u} \cdot \mathbf{v} = \|\mathbf{u}\| \|\mathbf{v}\| \cos\theta$$
  • Orthogonal Projection (正交投影): /prəˈdʒekʃn/ The shadow of vector $\mathbf{v}$ onto line spanned by $\mathbf{u}$.
    $$\text{proj}_{\mathbf{u}}\mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u}$$

Gram-Schmidt, QR & SVD

  • Gram-Schmidt & QR (正交化与 QR 分解): /ɡræm ʃmɪt/ Converting vectors into orthonormal basis $Q$. Matrix form: $A = QR$.
  • Singular Value Decomposition (SVD 奇异值分解): /ˈsɪŋɡjələr ˈvæljuː/ Factoring any matrix $A = U \Sigma V^T$ into Rotation ($V^T$) $\to$ Scaling ($\Sigma$) $\to$ Rotation ($U$).

Least Squares & Pseudo-Inverse

  • Least Squares Approximation (最小二乘法): Solving inconsistent $A\mathbf{x} = \mathbf{b}$ by projecting $\mathbf{b}$ onto $\text{Col}(A)$:
    $$A^T A \hat{\mathbf{x}} = A^T \mathbf{b} \implies \hat{\mathbf{x}} = (A^T A)^{-1} A^T \mathbf{b}$$
  • Moore-Penrose Pseudo-Inverse (伪逆): $A^+ = V \Sigma^+ U^T$, generalizes inverse to non-square matrices.

1. Vector Projection & Orthogonal Decomposition

Drag vector endpoints to observe orthogonal projection $\text{proj}_{\mathbf{u}}\mathbf{v}$ and orthogonal complement component $\mathbf{v}^{\perp}$.

Decomposition: v = proj + v^⊥
$u_x$: 3.0
$u_y$: 0.0
$v_x$: 2.0
$v_y$: 3.0
$\text{proj}_{\mathbf{u}}\mathbf{v} =$: [2.00, 0.00]
$\mathbf{v}^{\perp} = \mathbf{v} - \text{proj} =$: [0.00, 3.00]
Dot Product $\mathbf{u} \cdot \mathbf{v} =$: 6.00
Orthogonality Check: $(\text{proj}_{\mathbf{u}}\mathbf{v}) \cdot \mathbf{v}^{\perp} = 0.00$ (Perfect Right Angle!).
💡 Drag vector tips on canvas

2. Gram-Schmidt & QR Decomposition Laboratory

Drag two source vectors and follow normalization, projection subtraction, and QR assembly step by step.

QR: Step 0 / 3
$u_x$:3.0
$u_y$:1.0
$v_x$:1.0
$v_y$:3.0
‖u‖ =3.162
r₁₂ = q₁ · v =1.897
‖u₂‖ =2.530
QᵀQ:[[1, 0], [0, 1]] Upper-triangular R:[[3.162, 1.897], [0, 2.530]] Reconstructed QR:[[3, 1], [1, 3]]
Step 0: use u and v as the two columns of A.
💡 Drag either source vector to restart the QR steps

3. Least-Squares Linear Regression Laboratory

Drag five data points to see how the fitted line, residuals, and normal equation change.

Least-Squares Fit
Fitted Model:ŷ = 1.1x + 0.6
Residual Sum of Squares (SSE):0.12
Coefficient of Determination (R²):0.99
Normal Equation AᵀAθ = Aᵀy:
💡 Drag any point to refit the line

4. PCA Dimensionality-Reduction Laboratory

Drag six 2D points to inspect centered covariance axes and their 1D projection onto the first principal component.

PCA: 2D → 1D
Mean μ:[0, 0]
Eigenvalues:λ₁ = 0, λ₂ = 0
Explained Variance (PC₁ / PC₂):
Covariance Matrix C:[[0, 0], [0, 0]] First Principal Direction:[1, 0]
💡 Drag any point to recompute PCA

5. Singular Value Decomposition (SVD) Geometric Visualizer

Observe how matrix $A = U \Sigma V^T$ transforms the unit circle step-by-step: Rotate by $V^T$, Stretch by Singular Values $\sigma_1, \sigma_2$, and Rotate by $U$.

SVD: A = U Σ Vᵀ
Singular Value $\sigma_1 =$: 2.04
Singular Value $\sigma_2 =$: 0.94
Condition Num $\kappa(A) = \sigma_1/\sigma_2$: 2.17
Right singular vectors $v_1, v_2$ map to orthogonal principal axes of output ellipse $\sigma_1 u_1, \sigma_2 u_2$.
Module 6

Linear Algebra Quiz & Formula Cheatsheet

Test your linear algebra knowledge with 15 practice questions or review key formulas, SVD intuitions, and common pitfalls.

Question 1 of 15 Vectors & Span
Score: 0 / 100

Loading question...

Matrix Operations & Properties

Determinant Properties:

$$\det(AB) = \det(A)\det(B), \quad \det(A^T) = \det(A), \quad \det(cA) = c^n \det(A)$$

Trace Properties:

$$\text{tr}(AB) = \text{tr}(BA), \quad \text{tr}(A) = \sum_{i=1}^n \lambda_i$$

Rank-Nullity Theorem: /ræŋk ˈnʌləti/

$$\text{Rank}(A) + \text{Nullity}(A) = n \quad (\text{for } m \times n \text{ matrix } A)$$

Four Fundamental Subspaces

Strang's Fundamental Subspaces Theorem:
  • 1. Column Space $\text{Col}(A)$: Dim = $r$, subspace of $\mathbb{R}^m$.
  • 2. Nullspace $\text{Null}(A)$: Dim = $n-r$, subspace of $\mathbb{R}^n$. $\text{Null}(A) \perp \text{Row}(A)$.
  • 3. Row Space $\text{Row}(A) = \text{Col}(A^T)$: Dim = $r$, subspace of $\mathbb{R}^n$.
  • 4. Left Nullspace $\text{Null}(A^T)$: Dim = $m-r$, subspace of $\mathbb{R}^m$. $\text{Null}(A^T) \perp \text{Col}(A)$.

Positive Definite Matrix

Positive Definite /ˈpɒzətɪv ˈdefɪnət/

A real symmetric matrix $A$ is positive definite ($A \succ 0$) iff any of the following equivalent conditions holds:

  • 1. $\mathbf{x}^T A \mathbf{x} > 0$ for every non-zero vector $\mathbf{x} \neq \mathbf{0}$.
  • 2. All eigenvalues $\lambda_i > 0$ are strictly positive.
  • 3. All leading principal minors are strictly positive ($\det(A_k) > 0$).
  • 4. A Cholesky factorization exists: $A = L L^T$.

Singular Value Decomposition (SVD)

Singular Value Decomposition /ˈsɪŋɡjələr ˈvæljuː/

For any $m \times n$ matrix $A$:

$$A = U \Sigma V^T$$

  • $U$: $m \times m$ orthogonal matrix of left singular vectors (eigenvectors of $A A^T$).
  • $\Sigma$: $m \times n$ diagonal matrix of singular values $\sigma_i = \sqrt{\lambda_i(A^T A)}$.
  • $V$: $n \times n$ orthogonal matrix of right singular vectors (eigenvectors of $A^T A$).

Least Squares & PCA Applications

Normal Equations:

$$A^T A \hat{\mathbf{x}} = A^T \mathbf{b}$$

Projection matrix onto $\text{Col}(A)$: $P = A(A^T A)^{-1}A^T$.

PCA (Principal Component Analysis):

Sample covariance $C = \frac{1}{n} X^T X$. Applying SVD to the centered data matrix $X = U \Sigma V^T$ gives right singular vectors $V$ as the principal directions.

Common Linear Algebra Pitfalls

Pitfall 1: Matrix Multiplication is Non-Commutative!

$AB \neq BA$ in general. $(AB)^T = B^T A^T$ and $(AB)^{-1} = B^{-1}A^{-1}$.

Pitfall 2: Eigenvalue vs. Singular Value—what is the difference?

Eigenvalues apply only to square matrices and can be complex or negative. Singular values apply to any rectangular matrix and are always non-negative real numbers $\sigma_i \ge 0$.