Skip to content

A modern Next.js web application for advanced linear algebra operations featuring matrix calculations, eigenanalysis, decompositions, and system solving with an elegant glassmorphism UI.

Notifications You must be signed in to change notification settings

sakethksg/LinearLab

Repository files navigation

Linear Algebra Calculator

A modern, elegant web application for performing advanced linear algebra operations with a beautiful glassmorphism UI.

Linear Algebra Calculator TypeScript Tailwind CSS

✨ Features

Matrix Operations

  • Basic Operations: Addition, Multiplication, Transpose
  • Advanced Computations: Determinant, Inverse, Rank
  • Eigenanalysis: Eigenvalues & Eigenvectors
  • Decompositions: LU, QR decomposition

Vector Operations

  • Dot Product: For vectors of any dimension
  • Cross Product: For 3D vectors

System Solving

  • Linear Systems: Solve Ax = b equations
  • Multiple solution types: Unique, infinite, or least-squares solutions

Design Features

  • 🎨 Glassmorphism UI: Beautiful transparent glass-like interface with black and gray theme
  • πŸŒ‘ Modern Dark Theme: Elegant black to gray gradient backgrounds
  • πŸ” Real-time Feedback: Instant error handling and validation
  • πŸ“± Responsive Design: Works perfectly on all devices
  • ⚑ Fast Performance: Server-side calculations with Next.js API routes
  • 🎯 Type Safety: Full TypeScript implementation with strict type checking

πŸš€ Technology Stack

Component Technology
Framework Next.js 15 (App Router)
Language TypeScript 5.7
UI Library shadcn/ui (Radix UI primitives)
Styling Tailwind CSS with glassmorphism
Math Engine mathjs 14.0
Icons Lucide React

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ and npm/yarn/pnpm
  • Modern web browser

Quick Start

  1. Clone the repository:

    git clone https://github.com/sakethksg/Linear-Algebra-Calculator.git
    cd Linear-Algebra-Calculator
  2. Install dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Run the development server:

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
  4. Open your browser:

    http://localhost:3000
    

🎯 Usage

Matrix Input Format

Matrices are entered as text with rows separated by semicolons:

1 2 3; 4 5 6; 7 8 9

This represents:

[ 1  2  3 ]
[ 4  5  6 ]
[ 7  8  9 ]

Vector Input Format

Vectors are space-separated values:

1 2 3 4 5

Available Operations

Basic Matrix Operations

  • Addition: Add two matrices of same dimensions
  • Multiplication: Multiply compatible matrices
  • Transpose: Flip rows and columns
  • Determinant: Calculate determinant of square matrices
  • Inverse: Find inverse of non-singular matrices
  • Rank: Determine matrix rank

Advanced Operations

  • Eigenvalues & Eigenvectors: Compute with complex number support
  • System Solver: Solve linear systems Ax = b

Vector Operations

  • Dot Product: Scalar product of vectors
  • Cross Product: Vector product (3D only)

Decompositions

  • LU Decomposition: Lower-Upper factorization
  • QR Decomposition: Orthogonal-triangular factorization

πŸ—οΈ Project Structure

Linear-Algebra-Calculator/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/              # Next.js API routes
β”‚   β”‚   β”œβ”€β”€ matrix/       # Matrix operations endpoints
β”‚   β”‚   β”œβ”€β”€ vector/       # Vector operations endpoints
β”‚   β”‚   └── system/       # System solver endpoint
β”‚   β”œβ”€β”€ layout.tsx        # Root layout
β”‚   β”œβ”€β”€ page.tsx          # Main page
β”‚   └── globals.css       # Global styles with glassmorphism
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚   β”œβ”€β”€ MatrixOperation.tsx
β”‚   β”œβ”€β”€ VectorOperation.tsx
β”‚   β”œβ”€β”€ EigenCalculator.tsx
β”‚   β”œβ”€β”€ SystemSolver.tsx
β”‚   └── DecompositionCalculator.tsx
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ matrix-utils.ts   # Matrix calculation utilities
β”‚   β”œβ”€β”€ vector-utils.ts   # Vector calculation utilities
β”‚   └── utils.ts          # Helper functions
└── public/               # Static assets

🚒 Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Deploy automatically

Build for Production

npm run build
npm start

🎨 Customization

Modify Glassmorphism Theme

Edit app/globals.css to customize the glass effects:

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.125);
}

Change Color Scheme

Edit tailwind.config.ts to customize colors and theme. Current theme uses black to gray gradients for a modern, elegant look.

🐳 Docker Deployment

Build and run with Docker:

docker build -f Dockerfile.nextjs -t linear-algebra-calc .
docker run -p 3000:3000 linear-algebra-calc

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

πŸ“§ Contact

Project Link: https://github.com/sakethksg/Linear-Algebra-Calculator


Built with ❀️ using Next.js, TypeScript, and shadcn/ui

About

A modern Next.js web application for advanced linear algebra operations featuring matrix calculations, eigenanalysis, decompositions, and system solving with an elegant glassmorphism UI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published