Created
March 18, 2021 21:16
-
-
Save jamesamiller/6010a2d29fbbae48f44bf960b3f70744 to your computer and use it in GitHub Desktop.
Two-observer or spacetime diagram for general use. Special relativity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[crop=true, border=10pt]{standalone} | |
\usepackage{comment} | |
\begin{comment} | |
:Title: Coordinate Practice 1 | |
:Author: J A Miller (millerja@uah.edu), 2020/02/04, 2018/03/29 | |
Simple two-observer diagram for practice in reading primed and unprimed coordinates. | |
Plot style from McNees | |
https://gist.github.com/mcnees/45b9f53ad371c38ba6f3759df5880fb1 | |
\end{comment} | |
\usepackage{xcolor} | |
\usepackage{tikz} | |
\usetikzlibrary{arrows.meta} | |
\usetikzlibrary{angles} | |
\usetikzlibrary{quotes} | |
\definecolor{plum}{rgb}{0.36078, 0.20784, 0.4} | |
\definecolor{chameleon}{rgb}{0.30588, 0.60392, 0.023529} | |
\definecolor{cornflower}{rgb}{0.12549, 0.29020, 0.52941} | |
\definecolor{scarlet}{rgb}{0.8, 0, 0} | |
\definecolor{brick}{rgb}{0.64314, 0, 0} | |
\definecolor{sunrise}{rgb}{0.80784, 0.36078, 0} | |
\definecolor{lightblue}{rgb}{0.15,0.35,0.75} | |
\begin{document} | |
% Define the boost | |
\newcommand*\vrel{0.5} % velocity of primed frame | |
\newcommand*\gamrel{1.1547} % gamma of primed frame | |
\newcommand*\etarel{0.57735} % their product | |
% Set some points to plot, if desired | |
\newcommand*\xprimept{6} | |
\newcommand*\tprimept{4} | |
\newcommand*\xprimepti{-2} | |
\newcommand*\tprimepti{5} | |
\newcommand*\xprimeptii{7} | |
\newcommand*\tprimeptii{-3} | |
\pagestyle{empty} | |
\begin{tikzpicture}[scale=1,domain=-1:11] | |
\tikzstyle{axisarrow} = [-{Latex[inset=0pt,length=8pt]}] | |
\coordinate (origin) at (0,0); | |
% Draw the grid. | |
%\draw [cornflower!30,step=0.2,thin] (-1,-1) grid (11,11); % minor grid lines | |
\draw [cornflower!60,step=1.0,thin] (-1,-1) grid (11,11); % major grid lines | |
% Clip all lines that would fall outside the grid | |
\clip(-1,-1) rectangle (11,11); | |
% Draw unprimed axes | |
\draw[thick,axisarrow,cornflower] (0,-1) -- (0,11) node (tup) {}; | |
\node[inner sep=0pt] at (0.25,10.75) {$t$}; | |
\draw[thick,axisarrow,cornflower] (-1,0) -- (11,0) node (xup) {}; | |
\node[inner sep=0pt] at (10.75,-0.25) {$x$}; | |
% Draw primed axes | |
\draw[thick,axisarrow,scarlet] (0,0) -- (11*\vrel,11) node (tp) {}; | |
\node[inner sep=0pt] at (11*\vrel+0.25,10.75) {$t^\prime$}; | |
\draw[thick,axisarrow,scarlet] (0,0) -- (11,11*\vrel) node (xp) {}; | |
\node[inner sep=0pt] at (10.75,11*\vrel-0.35) {$x^\prime$}; | |
% Draw lines of constant xprime | |
\foreach \xprime in {-11,-10,-9,...,12} | |
{ | |
\draw[scarlet!60,thin] plot (\x,\x/\vrel - \xprime/\etarel); | |
} | |
% Draw lines of constant tprime | |
\foreach \tprime in {-11,-10,-9,...,12} | |
{ | |
\draw[scarlet!60,thin] plot (\x,\x*\vrel + \tprime/\gamrel); | |
} | |
\end{tikzpicture} | |
\end{document} |
Author
jamesamiller
commented
Mar 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment