Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

specrel-0.1.0.tar.gz (23.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

specrel-0.1.0-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file specrel-0.1.0.tar.gz.

File metadata

  • Download URL: specrel-0.1.0.tar.gz
  • Upload date:
  • Size: 23.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for specrel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d5e9c8ba7578215fbbf7d1d2056633619608a809b491bfe6366d54596cdae2d8
MD5 60e3911c7ce0b997832f2b79036f9f23
BLAKE2b-256 fdf33ed41f50fdf37f7cc5d3cbd26a5d2c39ecbd7d3130fbb9f9dc8c3c118226

See more details on using hashes here.

File details

Details for the file specrel-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: specrel-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for specrel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4866e0c96764a21b2fff5b8e9353a3017f7ec1538915b5fd6965d431847527d
MD5 dd2471c7e7027b79e6951758f68f39a0
BLAKE2b-256 4841976c12781792d56ef82bec0dab8cb90ff6d15ca28657b0e2e29391e6ec6e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page