Skip to content

Instantly share code, notes, and snippets.

@jamesamiller
Created March 18, 2021 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesamiller/b211baf775ded2a5136844b4a5b6119f to your computer and use it in GitHub Desktop.
Save jamesamiller/b211baf775ded2a5136844b4a5b6119f to your computer and use it in GitHub Desktop.
Two coordinate systems with a 1-D boost in special relativity.
\documentclass[crop=true, border=10pt]{standalone}
\usepackage{comment}
\begin{comment}
:Title: Standard coordinate systems
:Author: J A Miller, UAH Physics & Astronomy, millerja@uah.edu
2020/07/01
The basic scenario of a primed coordinate system moving along the $x$ axis with a speed $v$
---------------------------------------------------------------------
Figure caption
---------------------------------------------------------------------
\caption{Our standard setup for the unprimed and primed reference frames. The primed frame moves along the $x$ axis with a velocity $v$ (which can be $>0$ or $<0$) relative to the unprimed frame, and the orientation of all axes is the same as in the unprimed frame.}
\end{comment}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{xcolor}
\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}
% ----------------------- parameter specifications ------------------------
% graph boundaries
\newcommand*{\xa}{-1}
\newcommand*{\ya}{-1}
\newcommand*{\xb}{7}
\newcommand*{\yb}{7}
\newcommand*{\spacing}{1}
% x and y scales
\newcommand*{\xscale}{1cm}
\newcommand*{\yscale}{1cm}
% some calculations now ...
% ------------------------ other functions ------------------------------
% ------------------------ begin figure ------------------------------
\begin{document}
\begin{tikzpicture}[
scale=1,
%domain=\xa:\xb,
x=\xscale,y=\yscale,
axisarrow/.style=-{Latex[inset=0pt,length=10pt]},
velocityarrow/.style=-{Latex[inset=0pt,length=20pt,fill=lightblue]},
minor gridlines/.style={cornflower!30,step=0.2,thin},
major gridlines/.style={cornflower!60,step=1.0,thin},
axes/.style={cornflower,thick,axisarrow}, % unprimed axes
primed axes/.style={scarlet,thick,axisarrow}, % primed axes
primed major gridlines/.style={scarlet!60,thin},
double primed axes/.style={chameleon,thick,axisarrow}, % double primed axes
double primed major gridlines/.style={chameleon!60,thin},
LOS/.style={cornflower,thick,dashed}, % line of simultaneity in unprimed frame
LOS primed/.style={scarlet,thick,dashed}, % line of simultaneity in primed frame
LOS double primed/.style={chameleon,thick,dashed}, % line of simultaneity in primed frame
light ray/.style={sunrise,thick,axisarrow},
textnode/.style={inner sep=0pt}, % for a text only node
dot/.style={circle,draw=scarlet!70,fill=scarlet!20,inner sep=1.5pt}
]
% In case we need to increase the font size because of a large diagram
\tikzset{every node/.style={scale=1.2}};
% some coordinates
\coordinate (O) at (0,0);
% Draw the grid for the unprimed frame
%\draw [minor gridlines] (\xa,\ya) grid (\xb,\yb);
\draw [major gridlines] (\xa,\ya) grid (\xb,\yb);
% Draw unprimed axes
\draw[axes,name path=taxis] (0,\ya) -- (0,\yb);
\node[textnode] at (0.3,\yb-0.5) {$t$};
\draw[axes,name path=xaxis] (\xa,0) -- (\xb,0);
\node[textnode] at (\xb-0.5,-0.3) {$x$};
% Draw the grid for the primed frame
%\draw [minor gridlines] (\xa,\ya) grid (\xb,\yb);
\draw [primed major gridlines] (\xb+\spacing,\ya) grid (\xb+\spacing +\xb-\xa,\yb);
% Draw primed axes
\draw[primed axes,name path=tpaxis] (\xb+\spacing+1,\ya) -- (\xb+\spacing+1,\yb);
\node[textnode] at (\xb+\spacing+1+0.3,\yb-0.5) {$t^\prime$};
\draw[primed axes,name path=xpaxis] (\xb+\spacing,0) -- (\xb+\spacing +\xb-\xa,0);
\node[textnode] at (\xb+\spacing +\xb-\xa-0.5,-0.3) {$x^\prime$};
\draw[velocityarrow,ultra thick] ( \xb+\spacing+2,1.5)-- ( \xb+\spacing+5,1.5) node[textnode,label={right:\Large $v$}] (v) {};
\node[textnode,label={right: Unprimed frame}] at (2.2,6.2) {};
\node[textnode,label={right: Primed frame}] at (11.2,6.2) {};
\end{tikzpicture}
\end{document}
@jamesamiller
Copy link
Author

fig-coorsys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment