Metadata-Version: 2.4
Name: linear-algebra-visualizer
Version: 0.1.0
Summary: Educational NumPy and Matplotlib visualizations for linear algebra.
Author: Md. Masud
License: MIT
Keywords: linear algebra,visualization,numpy,matplotlib,education
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26
Requires-Dist: matplotlib>=3.8
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: jupyter>=1.0; extra == "dev"
Requires-Dist: ipykernel>=6.0; extra == "dev"
Dynamic: license-file

# 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:

```bash
python -m pip install linear-algebra-visualizer
```

For local development from the source tree:

```bash
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

```python
import numpy as np
from laviz import plot_transformation, rotation

T = rotation(45)
plot_transformation(T, vector=np.array([2, 1]))
```

```python
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

```bash
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.
