Skip to content

OasisFrontEndStudio/Eigenvalue-Mapping-Visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Eigenvalue Mapping Visualization

A professional, interactive web application for visualizing matrix eigenvalues and their transformations. This application provides a comprehensive platform to explore different types of matrices, compute their eigenvalues using advanced numerical methods, and visualize how these matrices transform the coordinate system.

Features

Matrix Types

  • Custom matrices: User-defined values with real-time editing
  • Identity matrices: Diagonal matrices with ones on the diagonal
  • Zero matrices: All elements are zero
  • Random matrices: Random values between -5 and 5
  • Diagonal matrices: Non-zero values only on the diagonal
  • Symmetric matrices: Equal elements across the diagonal
  • Upper triangular matrices: Non-zero values only above and on the diagonal
  • Lower triangular matrices: Non-zero values only below and on the diagonal
  • Circulant matrices: Each row is a cyclic shift of the previous row
  • Permutation matrices: Exactly one 1 in each row and column

Matrix Sizes

  • 2x2 matrices (exact eigenvalue computation)
  • 3x3 matrices (QR algorithm)
  • 4x4 matrices (QR algorithm)
  • 5x5 matrices (QR algorithm)

Eigenvalue Computation

  • Exact computation for 2x2 matrices using characteristic equation
  • QR algorithm for larger matrices with convergence checking
  • Support for both real and complex eigenvalues
  • High-precision results with up to 6 decimal places
  • Convergence indicators for numerical methods

Visualizations

  • Eigenvalue spectrum plot on the complex plane with axes labels
  • Enhanced transformation mapping showing original and transformed grids
  • Color-coded eigenvalues for easy identification
  • Interactive canvas with hover effects
  • Grid and axis overlays for better spatial reference

Interactive Interface

  • Modern, professional UI with card-based layout
  • Real-time matrix editing with instant validation
  • Loading states for better user experience
  • Responsive design for all screen sizes
  • Smooth animations and transitions

Getting Started

Prerequisites

  • A modern web browser (Chrome, Firefox, Safari, Edge)
  • No additional software or libraries required

Installation

  1. Clone or download this repository
  2. Open index.html in your web browser
  3. No server setup is required - the application runs entirely in the browser

Usage

  1. Select Matrix Type:

    • Choose from the dropdown menu to select a predefined matrix type
    • Or select "Custom Matrix" to manually enter values
  2. Choose Matrix Size:

    • Select from 2x2 to 5x5 matrices based on your needs
  3. Generate or Edit Matrix:

    • Click "Generate Matrix" to create a matrix of the selected type and size
    • Or manually edit the matrix values in the input fields
  4. Compute Eigenvalues:

    • Click "Compute Eigenvalues" to calculate and visualize the results
    • The eigenvalues will be displayed numerically with color-coded formatting
    • The eigenvalue spectrum will be plotted on the complex plane
    • The transformation mapping will show how the matrix distorts the coordinate system

Mathematical Background

Eigenvalues and Eigenvectors

For a square matrix ( A ), an eigenvalue ( lambda ) and corresponding eigenvector ( mathbf{v} ) satisfy the equation:

[ Amathbf{v} = lambdamathbf{v} ]

Eigenvalues provide fundamental insights into the behavior of linear transformations:

  • Real eigenvalues: Indicate stretching or compression along specific directions
  • Complex eigenvalues: Indicate rotation combined with scaling
  • Magnitude: Determines the scaling factor of the transformation
  • Phase (for complex eigenvalues): Determines the rotation angle

QR Algorithm

The QR algorithm is a powerful numerical method for computing eigenvalues of square matrices. It works by iteratively transforming the matrix into an upper triangular form using QR decompositions, where the eigenvalues can be easily extracted from the diagonal.

Transformation Mapping

The transformation mapping visualization demonstrates how a matrix transforms a regular grid. This helps in understanding:

  • How vectors are scaled and rotated by the transformation
  • The geometric interpretation of eigenvalues and eigenvectors
  • The overall behavior of linear systems
  • The relationship between matrix structure and transformation effects

Technical Details

Architecture

The application follows a modular architecture with clear separation of concerns:

Eigenvalue Mapping Visualization/
├── index.html          # Main HTML structure
├── styles.css          # Comprehensive styling and responsive design
├── script.js           # Core functionality and algorithms
└── README.md           # Documentation

Implementation

  • HTML5: Semantic structure with accessibility considerations
  • CSS3: Modern styling with CSS variables, grid layout, and responsive design
  • JavaScript (ES6+): Object-oriented design with modular code organization
  • Canvas API: High-performance 2D rendering for visualizations

Algorithm Details

2x2 Matrices

  • Exact solution using the characteristic equation: [ lambda^2 - ext{tr}(A)lambda + det(A) = 0 ] where ( ext{tr}(A) ) is the trace and ( det(A) ) is the determinant

Larger Matrices

  • QR decomposition using Gram-Schmidt orthogonalization
  • Iterative refinement with convergence checking (tolerance: 1e-6)
  • Maximum iterations: 100
  • Complex eigenvalue detection for non-diagonalizable matrices

Browser Compatibility

  • Chrome: 70+
  • Firefox: 65+
  • Safari: 13+
  • Edge: 79+

Design Principles

Visual Design

  • Professional color palette with consistent theming
  • Card-based layout for clear information hierarchy
  • Subtle shadows and transitions for depth and interactivity
  • Responsive grid system for optimal display on all devices

User Experience

  • Intuitive controls with clear labeling
  • Real-time feedback for all user actions
  • Loading states to manage computational delays
  • Comprehensive information without overwhelming the user

Performance

  • Efficient algorithms optimized for browser execution
  • Lazy computation - only calculate when needed
  • Canvas rendering for high-performance visualizations
  • Memory management for large matrices

Educational Value

This application serves as an excellent educational tool for:

  • Linear algebra students: Visualize abstract concepts
  • Engineers and scientists: Test matrix properties quickly
  • Educators: Demonstrate eigenvalue concepts interactively
  • Anyone interested in linear algebra: Explore matrix transformations visually

Future Enhancements

  • 3D visualization for higher-dimensional matrices
  • Eigenvector visualization with interactive components
  • Matrix multiplication and composition tools
  • Save/load matrix configurations with JSON export
  • Export visualizations as PNG/SVG
  • Additional matrix types (orthogonal, unitary, Hermitian)
  • Mathematical explanations for each matrix type
  • Performance benchmarks for different algorithms
  • Multi-language support

License

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue for bugs and feature requests.

Acknowledgments

  • Inspired by linear algebra courses and educational resources
  • Built with modern web technologies for maximum accessibility
  • Designed to balance educational value with visual appeal
  • Optimized for both learning and practical use

Contact

For questions, suggestions, or feedback, please open an issue on the project repository.


Happy matrix exploring! 📊✨

About

as the name said

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published