Data Space PC1: — PC2: — Total: —
Select a dataset or click to add points

Variance Captured

PC1
0%
PC2
0%
Cov
0
Combined
0%

PCA Explorer

Drag the axis handles to rotate your own principal components and watch how the captured variance changes. PCA finds the directions that maximize variance — can you find them by hand?

Interactions

  • Drag axis handles (circles at arrow tips) to rotate
  • Click canvas to add data points
  • Snap to PCA animates to the optimal directions
  • Lock orthogonal keeps axes perpendicular
  • Watch the variance bars — PCA maximizes Axis 1

What to Notice

  • The optimal PC1 aligns with the covariance ellipse’s long axis
  • Projection lines are shortest when axes align with PCA
  • Uncorrelated data has equal variance in all directions
  • The ghost lines show where the true PCs are

PCA Steps

  1. Center the data by subtracting the mean
  2. Compute the 2×2 covariance matrix
  3. Eigendecompose — eigenvectors are the PC directions, eigenvalues are the variances
  4. Sort by eigenvalue (largest first = PC1)
  5. Project data onto the top-k eigenvectors

Why Maximize Variance?

Maximizing variance along the projection axis preserves the most information about the data’s spread. Equivalently, it minimizes the reconstruction error (the projection line lengths).

Distributions Along Axes

Covariance Matrix

Add points to see the covariance matrix.

Eigenvectors & Eigenvalues

Computed after adding points.

Variance Along Your Axes

Drag the axes to see live variance calculations.
0.50
0.50