make me a website where I can use sliders to specify the matrix size, for example, 3 by…
- User
make me a website where I can use sliders to specify the matrix size, for example, 3 by 4, and then I can fill it in. Also, add a separate tab for the Cramer-Gauss method and the matrix method, and include the calculation of determinants by reducing the order, decomposing by row and column, and converting to a triangular form.
Assistant
I'll build a comprehensive linear algebra calculator website with matrix input, determinant calculations, Cramer's method, Gauss elimination, and the matrix method. Let me start by exploring the project structure and then building everything.
Now let me build the entire application. I'll start with the matrix utility functions, then create all the components.
Let me fix the reference error in the matrix utilities:
Now let me create the MatrixInput component:
Let me fix the lint errors:
Now let me create the DeterminantCalculator component:
Now let me create the Cramer-Gauss component:
Now let me create the MatrixMethod component:
Now let me create the main App component that ties everything together:
Now let me build the project to check for errors:
The project builds successfully. Let me verify the components are all working well together by doing a quick review:
The build succeeded. Let me now enhance the styling and UX a bit - improving the dark theme, adding better visual hierarchy, and some polish:
The build is successful. Let me enhance the DeterminantCalculator with more visual detail and improve the step-by-step display:
The build is successful. Let me enhance the CramerGauss component to show the modified matrices for Cramer's Rule:
The build is successful. Let me do a final check on the index.html title:
Let me enhance the MatrixInput component with better styling and labels:
The build is successful. Let me verify the complete file structure:
The website is fully built and ready. Here's a summary of what was created:
Linear Algebra Calculator
Features:
Matrix Input (with sliders)
- Sliders to set matrix dimensions (1×1 to 6×6)
- Input fields for matrix A and vector b (augmented system)
- Preset examples: 2×2, 3×3, 4×4 systems, and upper triangular
Tab 1: 📐 Determinant — 5 calculation methods:
- Direct Formula — formulas for 2×2, 3×3, cofactor expansion for larger
- Decomposition by Row — cofactor expansion along any row with minor matrices shown
- Decomposition by Column — cofactor expansion along any column with minor matrices shown
- Reducing the Order — step-by-step Laplace expansion
- Triangular Form — Gaussian elimination to upper triangular; step-by-step navigation with diagonal highlighting
Tab 2: 🧮 Cramer & Gauss — 3 solving methods:
- Cramer's Rule — shows det(A), D₁...Dₙ matrices with highlighted replaced columns, and x = Dᵢ/det(A)
- Gauss Elimination — forward elimination + back substitution with step-by-step or all-steps view
- Gauss-Jordan — full elimination to reduced row echelon form with step navigation
Tab 3: 🔢 Matrix Method
- Computes x = A⁻¹ · b
- Shows determinant, adjugate, inverse matrix, and final solution
- Toggle to show/hide the inverse matrix
- Verification: Ax = b check
Files created:
src/utils/matrix.ts— All linear algebra computation functionssrc/components/MatrixInput.tsx— Sliders + matrix input with visual bracketssrc/components/DeterminantCalculator.tsx— All 5 determinant methodssrc/components/CramerGauss.tsx— Cramer's rule + Gauss solverssrc/components/MatrixMethod.tsx— Inverse matrix solversrc/App.tsx— Main app with tab navigation and preset examples
Files built:
index.html,src/utils/matrix.ts,src/components/MatrixInput.tsx,src/components/DeterminantCalculator.tsx,src/components/CramerGauss.tsx,src/components/MatrixMethod.tsx,src/App.tsx
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.