Skip to content

Latest commit

 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Special Relativity

PyPI version Tests GitHub

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.

At a Glance

Spacetime Plots

The Relativity of Simultaneity

Relativity of simultaneity

Faster-Than-Light Communication

Faster-than-light communication

Lorentz Transformations

The Lorentz transformation about some origin

Simple Spacetime Animations

Time Dilation

Time dilation

Length Contraction

Length contraction

Sequential, Multi-Part Spacetime Animations

The Ladder Paradox

The ladder paradox

The Twin Paradox

The twin paradox

Dependencies

  • Matplotlib for plot generation
  • FFmpeg for video file writing (for saving animations)

Installation

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).

Usage

Acknowledgements

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.

About

Flexible graphics/animation generation for special relativity

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages