An online linear algebra computation tool, rebuilt with React + TypeScript. All calculations run locally in the browser.
Features#
| Module | Description |
|---|---|
| Determinant | Determinant of any square matrix (Laplace expansion) |
| Matrix Operations | Addition, subtraction, multiplication, scalar multiplication, transpose, inverse, adjugate, rank, trace, eigenvalues/eigenvectors |
| Vector Operations | Addition, subtraction, scalar multiplication, dot product, cross product, magnitude, angle, orthogonality check |
| Linear Systems | Gaussian elimination, LU decomposition, fundamental solution set, general solution |
| Vector Groups | Linear dependence check, maximal independent subset, rank of vector group, Gram-Schmidt orthogonalization |
| Quadratic Forms | Canonical form (orthogonal transformation), normal form, positive definiteness check |
Tech Stack#
| Category | Technology |
|---|---|
| Framework | Vite 6 + React 18 + TypeScript |
| CSS | Tailwind CSS 3 (PostCSS CLI) |
| Component Library | shadcn/ui (Button, Card, Select, Input, etc.) |
| Icons | lucide-react |
| Math Engine | Fraction class (exact rational arithmetic, no floating-point errors) |
| Storage | localStorage (history, theme preference, language preference) |
| i18n | Built-in Chinese/English bilingual, runtime switching |
Project Structure#
1linear_algebra/
2├── index.html # Vite entry point
3├── src/
4│ ├── main.tsx # React mount entry
5│ ├── App.tsx # Main app component (routing + state management)
6│ ├── index.css # Tailwind + shadcn CSS variables
7│ ├── components/
8│ │ ├── ui/ # shadcn/ui components
9│ │ │ ├── button.tsx
10│ │ │ ├── card.tsx
11│ │ │ ├── input.tsx
12│ │ │ ├── select.tsx
13│ │ │ ├── scroll-area.tsx
14│ │ │ ├── badge.tsx
15│ │ │ └── separator.tsx
16│ │ ├── Layout/ # Layout components
17│ │ │ ├── Sidebar.tsx
18│ │ │ ├── TopBar.tsx
19│ │ │ └── Footer.tsx
20│ │ ├── modules/ # 6 core modules
21│ │ │ ├── Determinant.tsx
22│ │ │ ├── MatrixOperations.tsx
23│ │ │ ├── VectorOperations.tsx
24│ │ │ ├── LinearSystem.tsx
25│ │ │ ├── VectorGroup.tsx
26│ │ │ └── QuadraticForm.tsx
27│ │ ├── MatrixInput.tsx # Matrix input control
28│ │ ├── VectorInput.tsx # Vector input control
29│ │ ├── MatrixDisplay.tsx # Matrix result display
30│ │ ├── VectorDisplay.tsx # Vector result display
31│ │ ├── ResultPanel.tsx # Result panel
32│ │ ├── StepsTimeline.tsx # Step-by-step timeline
33│ │ └── HistoryPanel.tsx # History panel
34│ ├── hooks/
35│ │ ├── useTheme.ts # Dark/Light mode
36│ │ └── useHistory.ts # History management
37│ ├── i18n/
38│ │ ├── I18nContext.tsx # i18n Context
39│ │ └── translations.ts # Chinese/English translation dictionary
40│ ├── lib/
41│ │ ├── fraction.ts # Fraction exact rational class
42│ │ ├── math-core.ts # Core linear algebra algorithms
43│ │ └── utils.ts # Utility functions
44│ └── types/
45│ └── index.ts # TypeScript type definitions
46├── package.json
47├── vite.config.ts
48├── tsconfig.json
49├── tailwind.config.js
50├── postcss.config.js
51├── components.json # shadcn/ui config
52└── assets/ # Icon assetsDevelopment#
1# Install dependencies
2npm install
3
4# Start dev server
5npm run dev
6
7# Production build
8npm run build
9
10# Preview build
11npm run previewDeployment#
Build output is in the dist/ directory. Deploy directly to GitHub Pages, Vercel, Netlify, or any static hosting platform.
Online Demo#
lyrumu.github.io/linear_algebra_calculator
License#
MIT License