linear-algebra-visualizer
An educational Python library for seeing linear algebra as geometry. It uses only NumPy and Matplotlib, so the formulas remain close to the code and work in both scripts and Jupyter notebooks.
Mathematical convention
All vectors are column vectors. A matrix acts on a vector as v_prime = A @ v; therefore A @ B @ v applies B first and A second. Coordinates use the usual Cartesian plane, and rotation(45) means a counterclockwise 45-degree rotation. Set radians=True when supplying radians.
Install
Install the released package from PyPI:
python -m pip install linear-algebra-visualizer
For local development from the source tree:
cd linear-algebra-visualizer
python -m pip install -e ".[dev]"
The runtime dependencies are numpy and matplotlib. Development extras add pytest, jupyter, and ipykernel. ipywidgets is intentionally optional; notebooks use ordinary code cells so the core package remains small.
Quick start
import numpy as np
from laviz import plot_transformation, rotation
T = rotation(45)
plot_transformation(T, vector=np.array([2, 1]))
from laviz import plot_composition, rotation, shear
T1 = rotation(90)
T2 = shear(kx=1)
plot_composition(T1, T2, np.array([1, 2]))
Main API
- Vectors:
plot_vector,plot_vectors,vector_add,vector_subtract,scalar_multiply,magnitude,normalize - Geometry:
dot_product,plot_dot_product,cross_product,plot_cross_product,project_vector,plot_projection - Matrices:
matrix_multiply,matrix_vector_multiply,multiplication_steps - Transformations:
identity,rotation,scale,shear,reflection,transform_vector,compose,plot_transformation,plot_composition - Area and inverse:
determinant,plot_determinant,inverse,plot_inverse - Spectral methods:
eigenvalues_eigenvectors,plot_eigenvectors,singular_value_decomposition,plot_svd,principal_components,project_onto_components,plot_pca
Structure
src/laviz contains compact modules organized by concept. tests verifies mathematical identities independently of rendering. notebooks contains twelve progressive lessons: vector operations through PCA.
Development
python -m pytest
jupyter notebook notebooks/
Plots return Matplotlib axes (or a figure and axes for multi-panel diagrams), making them composable. The 2D visualizers are intentionally limited to 2D because that is where grids, determinants, eigenvectors, SVD, and PCA can be inspected directly; cross products use Matplotlib's 3D axes.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linear_algebra_visualizer-0.1.0.tar.gz.
File metadata
- Download URL: linear_algebra_visualizer-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8685f4673708b9823a7c174b2fd85b2e70734721f300f2cb76a48668ecf3b451
|
|
| MD5 |
e5989fee389ca1724f5a0f8722ca7992
|
|
| BLAKE2b-256 |
1606241edcda7d6dc62bfc9d2b60381e6e75d0c0cb19dd08a374267940f7e5eb
|
File details
Details for the file linear_algebra_visualizer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: linear_algebra_visualizer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8be694c0624c661287ec9df45c7f38078e1288994a99b6fa2936e90d3c223c8c
|
|
| MD5 |
3b0974b5a330ca46674aaa8dcf22e29f
|
|
| BLAKE2b-256 |
68283e46eeeed3fba98c3a6c855b035c689768043991650ffb40ee624a66a013
|