Metadata-Version: 2.4
Name: specrel
Version: 0.1.0
Summary: Special relativity visualization sandbox
Project-URL: Homepage, https://github.com/johanngan/special_relativity
Project-URL: Issues, https://github.com/johanngan/special_relativity/issues
Author: Johann Gan
License-Expression: MIT
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: matplotlib>=3.9
Description-Content-Type: text/markdown

# Special Relativity
[![PyPI version](https://img.shields.io/pypi/v/specrel)](https://pypi.org/project/specrel)
![Tests](https://github.com/johanngan/special_relativity/actions/workflows/unittest.yml/badge.svg)
[![GitHub](https://img.shields.io/github/license/johanngan/special_relativity)](LICENSE)

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](figures/simultaneity.png)
#### Faster-Than-Light Communication
![Faster-than-light communication](figures/ftl.png)
### Lorentz Transformations
![The Lorentz transformation about some origin](figures/lorentztransform.gif)
### Simple Spacetime Animations
#### Time Dilation
![Time dilation](figures/timedilation.gif)
#### Length Contraction
![Length contraction](figures/lengthcontraction.gif)
### Sequential, Multi-Part Spacetime Animations
#### The Ladder Paradox
![The ladder paradox](figures/ladderparadox.gif)
#### The Twin Paradox
![The twin paradox](figures/twinparadox.gif)

# Dependencies

- [Matplotlib](https://matplotlib.org/) for plot generation
- [FFmpeg](https://ffmpeg.org/) 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
- For a walkthrough of how to use this package, see the [guided tour](https://johanngan.github.io/special_relativity/guided_tour/).
    - [Raw files](docs/guided_tour/README.md).
- For general documentation, see the [docs](https://johanngan.github.io/special_relativity/).
    - [Raw files](docs).
- For example code, see [examples](examples).

# Acknowledgements

The visualization tools in this project are somewhat inspired by [MinutePhysics's "Intro to Special Relativity" Course](https://www.youtube.com/playlist?list=PLoaVOjvkzQtyjhV55wZcdicAz5KexgKvm); 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.
