doruk.ch
· 5 min read

i built a calculator for my linear algebra class. then my classmates started using it.

i was taking linear algebra at FHNW. so i built a calculator that does everything the textbook does — with step-by-step explanations. then my classmates started using it.

pythoneducationopensourcemath

Linear Algebra Calculator

week 3 of linear algebra at FHNW. i'm staring at a matrix multiplication problem. i know the answer is wrong because the textbook says so. but i can't figure out where i went wrong because there are 12 intermediate steps and i lost track somewhere around step 7.

the textbook shows the final answer. the lecture notes show the method. but nobody shows you the step-by-step breakdown of your specific problem with your specific numbers so you can see exactly where your brain took a wrong turn.

so i opened my laptop and started building.

the first version

the initial version was embarrassingly simple. a python script that took two matrices, multiplied them, and printed every intermediate step. that's it. no UI. no web interface. just a CLI that spit out LaTeX-formatted math.

but it worked. i could paste in my homework problem, see every step, and find exactly where i was making mistakes. not the textbook's example — my actual numbers.

i added more operations. vector normalization. cross products. determinants. each one because i needed it for that week's problem set.

from script to web app

at some point i realized running python scripts in a terminal wasn't going to work for the classmates who kept asking me "can you run that thing for my homework too."

i rebuilt it as a Streamlit web app and put it at lag.doruk.ch. LAG stands for Lineare Algebra und Geometrie — the actual course code at FHNW. subtle branding.

now anyone could use it. no python installation needed. no terminal. just open a browser, pick an operation, enter your values, and get step-by-step solutions.

it also still has a TUI mode and a CLI mode for the terminal purists (me).

what it does

the feature list grew to match the entire course curriculum:

vectors:

  • normalization, projection, cross product
  • angle between vectors, collinearity checks
  • all with step-by-step LaTeX explanations

matrices:

  • add, subtract, multiply, transpose
  • determinant, inverse
  • eigenvalues and eigenvectors
  • batch matrix expression calculator (for when you have A * B^T * C and don't want to do it in three separate operations)

systems of linear equations:

  • gaussian elimination with every row operation shown
  • null space computation

3D geometry:

  • plane equations, distances, intersections
  • the spatial geometry stuff that makes everyone's brain hurt

extras:

  • series and summations
  • linear mapping analysis
  • interactive 3D visualizations with Plotly and Matplotlib

the key feature is always the step-by-step explanations. every operation shows intermediate results in LaTeX. because the answer isn't the point — understanding how you get there is.

the tech

the stack is Python all the way down:

  • Streamlit for the web interface
  • NumPy and SciPy for numerical computation
  • SymPy for symbolic math and LaTeX rendering
  • Plotly and Matplotlib for interactive visualizations
  • Pandas for data handling

the architecture uses a mixin-based pattern — each math domain (vectors, matrices, geometry) is a separate mixin class that gets composed into the main calculator. this makes it easy to add new modules without touching existing code. week 8 introduces eigenvalues? add an eigenvalue mixin. done.

it's at version 1.9.5 now. which means i've been iterating on it for a while.

what happened next

i shared the link in the class group chat. "hey i built this thing, might help with the homework."

within a week, half the class was using it. not because it gave them answers — wolfram alpha does that too. but because it showed the work. you could follow along step by step and actually learn the method.

the feedback loop was great. someone would message me: "it doesn't handle systems with infinite solutions." i'd fix it that evening. next day: "it works now but the null space output is confusing." fix it again. rapid iteration driven by actual users with actual problems.

why step-by-step matters

there's a difference between knowing the answer and understanding the process. math education has this weird gap where textbooks explain concepts abstractly and then show one worked example. but when you're learning, you need to see many examples — specifically, your examples, with your numbers.

that's what the calculator does. it's not a shortcut. it's a learning tool. you still have to understand what gaussian elimination is and why it works. but when you're stuck on row 3, column 2, you can see exactly what operation was applied and what the result should be.

i built it because that's how i learn. not from being told the answer, but from seeing the process broken down until each step is obvious. turns out that's how a lot of people learn.

the honest take

the linear algebra calculator started as a coping mechanism for a hard class. it turned into something my classmates actually relied on. it's not the flashiest project in my portfolio — no AI, no viral moment, no radio feature.

but it might be the most useful thing i've ever built. because it helped people learn something they were struggling with. and sometimes that matters more than stream counts.

the whole thing is open source. if you're taking a linear algebra course and the textbook isn't cutting it, give it a try.


lag.doruk.ch | GitHub

On this page