A hands-on learning repository for understanding linear algebra concepts through Python and NumPy.
This repository contains a series of lessons that build your understanding of linear algebra from the ground up. Each lesson includes:
- Python code demonstrating concepts with NumPy
- Comprehensive notes explaining the theory and intuition
- Practical examples to reinforce understanding
- Python 3.x
- NumPy
Install dependencies:
pip install numpyIntroduction to Python fundamentals needed for the course.
- What vectors are (direction and size)
- Vector representation
- Vector addition concept
- Vector addition with NumPy
- Vector scaling (multiplying by scalars)
- Understanding direction and magnitude
- Calculating vector length using Pythagorean theorem
- Using
np.linalg.norm() - Understanding magnitude
- Finding distance between two points
- Vector subtraction for distance calculation
- Understanding
B - Aas a vector
- Dot product calculation
- Geometric meaning: alignment vs distance
- Perpendicular, same direction, and opposite direction vectors
- Cosine formula for angles
- Normalizing vectors by dividing by lengths
- Key cosine values (0°, 90°, 180°)
- Understanding alignment and cosine relationships
Each lesson directory contains:
*.py- Python implementation filesnotes.md- Detailed explanations and concepts
- Vectors represent direction and size, not just coordinates
- Dot product measures alignment, not distance
- Cosine removes vector length to measure only direction
- cos(θ) = 0 means perpendicular (90° angle)
- Clone this repository
- Navigate to a lesson directory
- Read the
notes.mdfile for theory - Run the Python files to see concepts in action
- Experiment with the code to deepen understanding
Follow the lessons in order (00 → 01 → 02 → ...) as each builds upon previous concepts. The progression takes you from basic vector understanding to advanced operations like calculating angles between vectors.
- All mathematical formulas use LaTeX notation for proper rendering
- Code examples use NumPy for efficient vector operations
- Concepts are explained both mathematically and intuitively