An interactive educational tool for visualizing special relativity concepts including time dilation, relativistic mass, and spacetime diagrams.
- Interactive visualization of relativistic effects
- Real-time calculations of:
- Time dilation
- Relativistic mass
- Energy (rest, kinetic, total)
- Spacetime components
- Dark theme interface optimized for physics visualization
- Animated clock visualization for time dilation
- Dynamic spacetime diagrams
- Clone this repository:
git clone https://github.com/yourusername/spacetime-visualizer.git
cd spacetime-visualizer
- Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Clone this repository:
git clone https://github.com/yourusername/spacetime-visualizer.git
cd spacetime-visualizer
- Create and activate a Conda environment:
conda env create -f environment.yml
conda activate spacetime-visualizer
Run the application using:
python run_spacetime_visualizer.py
The interface is divided into several sections:
- Left panel: Educational content and explanations
- Center: Interactive visualizations
- Right panel: Control parameters and calculations
Built using:
- PyQt5 for the GUI
- pyqtgraph for high-performance scientific graphics
- NumPy for calculations
- Python 3.8+
spacetime_visualizer/
├── run_spacetime_visualizer.py # Main entry point
├── src/
│ ├── __init__.py
│ ├── physics.py # Relativistic calculations
│ ├── ui.py # Main UI components
│ ├── visualizations.py # Plot management
│ ├── clock_visualization.py # Time dilation animation
│ └── config.py # Theme and constants
├── requirements.txt
└── README.md
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.