An eigenvector is a direction a matrix doesn't rotate — it only stretches it. The eigenvalue is how much.
For a 2×2 matrix the characteristic equation det(A - λI) = 0 expands to a quadratic you can solve directly:
1trace = a + d2determinant = a*d - b*c3λ = (trace ± sqrt(trace² - 4*determinant)) / 2
Task: write eigenvalues(matrix) for a 2×2 matrix [[a, b], [c, d]], returning both eigenvalues sorted largest first, rounded to 4 decimal places.
The two invariants are worth remembering: the eigenvalues always sum to the trace and multiply to the determinant. That's a free check on any answer you compute, and it generalises to every size of matrix.