The specrel package is a Python 3 sandbox tool for understanding basic concepts in special relativity. Easily set up relativistic systems, perform Lorentz transformations, and create plots and animations through a relatively (get it?) simple API.
- Matplotlib for plot generation
- FFmpeg for video file writing (for saving animations)
The specrel package is meant for simple and/or interactive use. To install, run pip install specrel. If you want to save animations, you'll also have to install FFmpeg on your system.
If you don't want to use pip, you can also "install" the package directory manually by copying it to wherever you want to use it, or by adding the containing directory to the Python path (for example, with sys.path.append).
- For a walkthrough of how to use this package, see the guided tour.
- For general documentation, see the docs.
- For example code, see examples.
The visualization tools in this project are somewhat inspired by MinutePhysics's "Intro to Special Relativity" Course; the animated spacetime diagrams and Lorentz transformation animators in specrel serve a similar purpose to the "spacetime globe" (which is just an interactive spacetime diagram) employed throughout the course.
Knowledge of the details of special relativity comes from my own undergraduate education in physics.






