Gene Expression PCA Lab: Eigendecomposition & Clustering (2D)

This 2D companion runs the same statistical machinery as the 3D version through a plain canvas view built for reading the linear algebra rather than orbiting a scene: a synthetic gene-expression matrix is regenerated from adjustable cluster count, separation and noise, its real covariance matrix is diagonalized with a from-scratch Jacobi eigenvalue solver, and every sample is projected onto the top-2 principal components and plotted live, alongside an explained-variance readout and a scree-plot bar chart, so the effect of each parameter on the eigendecomposition is directly visible instead of implied.