expoweb/documents/therionprotractors/therionpage.tex

361 lines
11 KiB
TeX
Raw Normal View History

\documentclass[12pt,a4paper]{article}
%\documentclass[12pt,letter]{article}
% if using letter, make margin=5mm
2016-05-02 16:32:43 +01:00
2016-07-27 21:46:38 +01:00
% Change the scale using the value on line 24, and the size of the divisions on line 27
% The protractors are 4cm in radius
2016-05-02 16:32:43 +01:00
% packages
\usepackage{tikz}
\usepackage[outline]{contour}
\usepackage{standalone}
\usepackage[margin=10mm]{geometry}
2016-05-02 16:32:43 +01:00
2016-07-27 21:46:38 +01:00
\newcommand{\therionprotract}{
\begin{tikzpicture}[scale=1]
\contourlength{1.2pt}
% multiple styles
% Therionfalse generates table of cotangents
% Colourflase does what you'd expect
\newif\ifTherion
\newif\ifColour
%\Therionfalse
\Theriontrue
%\Colourfalse
\Colourtrue
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Set the coordinates and dimensions to draw from
% ********************************************************************************
% Origin
\coordinate (O) at (0,0);
% Scale of the protractor, change this to the desired scale
\pgfmathsetmacro{\scaleto}{250} % 1:scaleto
2016-07-27 21:46:38 +01:00
% Size of the major divisions on the linear scale
\pgfmathsetmacro{\majordivision}{1} % size in meters
% Size of the text numbers
2022-07-21 16:55:23 +01:00
\newcommand{\textsize}{\footnotesize}
2016-07-27 21:46:38 +01:00
% Intrinisc dimensions and conversion factors
\pgfmathsetmacro{\convert}{100} % conversion from meters to centimeters
\pgfmathsetmacro{\mintick}{0.1} % size in centimeters
\pgfmathsetmacro{\majtick}{0.2} % size in centimeters
\pgfmathsetmacro{\minradii}{0.5} % fractional radius where dotted radial lines start
\pgfmathsetmacro{\minradiiend}{1-\minradii} % remainder
% Size and scale of the drawing
\pgfmathsetmacro{\rad}{4} % size on page in cm
\pgfmathsetmacro{\majdiv}{\majordivision*\convert/\scaleto} % size on page in cm
\pgfmathsetmacro{\mindiv}{0.5*\majdiv} % size on page in cm
% Slightly reduced radii for the scale bar
\pgfmathsetmacro{\radscale}{\rad-\majdiv}
\pgfmathsetmacro{\linscale}{\rad-\mindiv}
2016-07-27 21:46:38 +01:00
% Numbers for labelling
\pgfmathsetmacro{\radius}{\rad*\scaleto/\convert} % size in meters
\pgfmathsetmacro{\minordivision}{0.5*\majordivision} % size in meters
% ********************************************************************************
% Draw the foreshortening lines
% ********************************************************************************
\ifTherion
2016-07-27 21:46:38 +01:00
% Vertical lines
\foreach \var in {0,\majdiv,...,\radscale}
2016-07-27 21:46:38 +01:00
{
\draw[gray] (O) ++ (\var,0) -- ++ (0,\rad);
\draw[gray] (O) ++ (-\var,0) -- ++ (0,\rad);
}
% White out the excess length
\draw[thick,white,fill=white] (O) ++ (\rad,0) arc(0:180:\rad) -- ++ (0,\rad) -- ++ (2*\rad,0) -- cycle;
% ********************************************************************************
% Draw the circumcircles
% ********************************************************************************
\foreach \var in {0,\majdiv,...,\rad}
2016-07-27 21:46:38 +01:00
{
\draw[gray] (O) ++ (\var,0) arc (0:180:\var);
}
\fi
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Draw the radii
% ********************************************************************************
%
% note these colours are duplicated from the Steve Wells and Joe Zokaties
% ``Cave Survey protractor'' previously sold % by american caving vendor IMO.
% Because of the black at 90, they are not evenly divided.
\ifColour
\foreach \theta in {10,50,100,140}
2016-07-27 21:46:38 +01:00
{
\draw[blue] (O) ++ (\theta:\majdiv) -- ++ (\theta:\radscale);
2016-07-27 21:46:38 +01:00
}
\foreach \theta in {20,60,110,150}
2016-07-27 21:46:38 +01:00
{
\draw[pink] (O) ++ (\theta:\majdiv) -- ++ (\theta:\radscale);
2016-07-27 21:46:38 +01:00
}
\foreach \theta in {30,70,120,160}
2016-07-27 21:46:38 +01:00
{
\draw[green] (O) ++ (\theta:\majdiv) -- ++ (\theta:\radscale);
}
\foreach \theta in {40,80,130,170}
{
\draw[gray] (O) ++ (\theta:\majdiv) -- ++ (\theta:\radscale);
2016-07-27 21:46:38 +01:00
}
\else
\foreach \theta in {10,20,...,170}
{
\draw[black] (O) ++ (\theta:\majdiv) -- ++ (\theta:\radscale);
}
\fi
\ifTherion
2016-07-27 21:46:38 +01:00
\foreach \theta in {5,15,...,175}
{
\draw[black,dotted] (O) ++ (\theta:\minradii*\rad) -- ++ (\theta:\minradiiend*\rad);
}
\fi
2016-07-27 21:46:38 +01:00
\draw[black,thick] (O) ++ (90:0) -- ++ (90:\radscale);
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Draw the angular scale
% ***************************h*****************************************************
2016-07-27 21:46:38 +01:00
\foreach \theta in {1,2,...,179}
{
% draw ticks from slightly outside of circle
\draw[black] (O) ++ (\theta:\rad+\mintick) -- ++ (\theta:-2*\mintick);
2016-07-27 21:46:38 +01:00
}
\foreach \theta in {5,10,...,175}
{
\draw[black,thick] (O) ++ (\theta:\rad) -- ++ (\theta:-\majtick);
}
% ********************************************************************************
% Draw the linear scale
% ********************************************************************************
\foreach \var in {0,\mindiv,...,\linscale}
2016-07-27 21:46:38 +01:00
{
% draw ticks from slightly outside of circle
\ifColour
\draw[red,thick] (O) ++ (-\var,-\mintick) -- ++ (0,2*\mintick);
\else
\draw[black,thick] (O) ++ (-\var,-\mintick) -- ++ (0,2*\mintick);
\fi
\draw[black,thick] (O) ++ (\var,-\mintick) -- ++ (0,2*\mintick);
2016-07-27 21:46:38 +01:00
}
%this is done in the numeric section. very weird
%
%\foreach \var in {0,\majdiv,...,\linscale}
%{
% \draw[black,thick] (O) ++ (\var,0) -- ++ (0,\majtick);
% \draw[red,thick] (O) ++ (-\var,0) -- ++ (0,\majtick);
%}
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Draw the outline
% ********************************************************************************
\draw[black,thick] (O) ++ (\rad,0) arc (0:180:\rad) -- cycle;
%\draw[black,thick] (O) -- ++ (0,\majtick);
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Draw the angle numbers
% ********************************************************************************
%
% note: we offset these in order to use a larger font and maintain legibility
%
2022-07-21 16:55:23 +01:00
\foreach \theta in {10,30,...,70}
2016-07-27 21:46:38 +01:00
{
\pgfmathsetmacro{\thetaopposite}{\theta+180}
\draw[black] (O) ++ (\theta:\rad) -- ++ (\theta:-\majtick) node[anchor=north,near start,sloped,rotate=-90,text=black] {
2016-07-27 21:46:38 +01:00
\textsize
\begin{tabular}{c}
\contour{white}{\pgfmathprintnumber{\theta}}\\
\ifColour
\contour{white}{\color{red}\pgfmathprintnumber{\thetaopposite}}
\else
\contour{white}{\pgfmathprintnumber{\thetaopposite}}
\fi
2016-07-27 21:46:38 +01:00
\end{tabular}
};
}
2022-07-21 16:55:23 +01:00
\foreach \theta in {20,40,...,80}
{
\pgfmathsetmacro{\thetaopposite}{\theta+180}
\draw[black] (O) ++ (\theta:\rad) -- ++ (\theta:-5*\majtick) node[anchor=north,near start,sloped,rotate=-90,text=black] {
\textsize
\begin{tabular}{c}
\contour{white}{\pgfmathprintnumber{\theta}}\\
\ifColour
\contour{white}{\color{red}\pgfmathprintnumber{\thetaopposite}}
\else
\contour{white}{\pgfmathprintnumber{\thetaopposite}}
\fi
2022-07-21 16:55:23 +01:00
\end{tabular}
};
}
\foreach \theta in {90,110,...,170}
2016-07-27 21:46:38 +01:00
{
\pgfmathsetmacro{\thetaopposite}{\theta+180}
\draw[black] (O) ++ (\theta:\rad) -- ++ (\theta:-\majtick) node[anchor=north,near start,sloped,rotate=90,text=black] {
2016-07-27 21:46:38 +01:00
\textsize
\begin{tabular}{c}
\contour{white}{\pgfmathprintnumber{\theta}}\\
\ifColour
\contour{white}{\color{red}\pgfmathprintnumber{\thetaopposite}}
\else
\contour{white}{\pgfmathprintnumber{\thetaopposite}}
\fi
2016-07-27 21:46:38 +01:00
\end{tabular}
};
};
2022-07-21 16:55:23 +01:00
\foreach \theta in {100,120,...,160}
{
\pgfmathsetmacro{\thetaopposite}{\theta+180}
\draw[black] (O) ++ (\theta:\rad) -- ++ (\theta:-5*\majtick) node[anchor=north,near start,sloped,rotate=90,text=black] {
\textsize
\begin{tabular}{c}
\contour{white}{\pgfmathprintnumber{\theta}}\\
\ifColour
\contour{white}{\color{red}\pgfmathprintnumber{\thetaopposite}}
\else
\contour{white}{\pgfmathprintnumber{\thetaopposite}}
\fi
2022-07-21 16:55:23 +01:00
\end{tabular}
};
};
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Draw the linear numbers
% ********************************************************************************
2022-07-21 16:55:23 +01:00
%\pgfmathsetmacro{\labmax}{\radius-\majordivision}
% FIXME this should be computable. need to figure out height of table from above section!
2022-07-21 16:55:23 +01:00
\pgfmathsetmacro{\labmax}{7} %hardcode as 7 so things fit right
2016-07-27 21:46:38 +01:00
\pgfmathsetmacro{\labsecond}{\majordivision+\majordivision}
\foreach \var in {\majordivision,\labsecond,...,\labmax}
{
\pgfmathsetmacro{\varpos}{\var*\convert/\scaleto}
2016-07-27 21:46:38 +01:00
\draw[black,thick] (O) ++ (\varpos,0) -- ++ (0,\majtick) node [above=-2pt] {\contour{white}{\textsize\pgfmathprintnumber{\var}}};
\ifColour
\draw[red,thick] (O) ++ (-\varpos,0) -- ++ (0,\majtick) node [above=-2pt] {\contour{white}{\textsize\color{red}\pgfmathprintnumber{\var}}};
\else
\draw[black,thick] (O) ++ (-\varpos,0) -- ++ (0,\majtick) node [above=-2pt] {\contour{white}{\textsize\pgfmathprintnumber{\var}}};
\fi
2016-07-27 21:46:38 +01:00
}
\draw[black,thick] (O) ++ (0,0) -- ++ (0,\majtick) node [above=-2pt] {\contour{white}{\textsize\pgfmathprintnumber{0}}};
2016-07-27 21:46:38 +01:00
% ********************************************************************************
% Draw the scale number
% ********************************************************************************
\ifTherion
\draw[black] (O) ++ (0,\rad/3) -- ++ (0,\rad/3) node [midway,anchor=center,sloped,text=black] {\contour{white}{\tiny $1$:\pgfmathprintnumber{\scaleto}}};
\else
\draw[black] (O) ++ (0,\rad/8) -- ++ (0,\rad/8) node [midway,anchor=center,text=black] {\contour{white}{\tiny $1$:\pgfmathprintnumber{\scaleto}}};
% Draw a table of conversions for non-therion
\renewcommand{\arraystretch}{0.1}
\draw[black] (O) ++ (0,\rad/3) -- ++ (0,\rad/3) node [midway,anchor=center,sloped,rotate=180,text=black]
{
\tiny
\setlength{\tabcolsep}{1pt}
\begin{tabular}{cl}
\contour{white}{0} & --- \\
& \contour{white}{1.0} \\
\contour{white}{18} & --- \\
& \contour{white}{0.9} \\
\contour{white}{32} & --- \\
& \contour{white}{0.8} \\
\contour{white}{41} & --- \\
& \contour{white}{0.7} \\
\contour{white}{50} & --- \\
& \contour{white}{0.6} \\
\contour{white}{57} & ---\\
& \contour{white}{0.5} \\
\contour{white}{63} & ---\\
& \contour{white}{0.4} \\
\contour{white}{70} & --- \\
& \contour{white}{0.3} \\
\contour{white}{76} & ---\\
& \contour{white}{0.2} \\
\contour{white}{81} & ---\\
& \contour{white}{0.1} \\
\contour{white}{87} & ---
\end{tabular}
};
%\draw[clear] (O) ++ (0,\rad/3) -- ++ (0,\rad/3) node [midway,anchor=center,sloped,rotate=180,text=black]
2016-07-27 21:46:38 +01:00
\fi
2016-07-27 21:46:38 +01:00
\end{tikzpicture}
}
2016-05-02 16:32:43 +01:00
\begin{document}
\begin{figure}
\centering
2016-05-02 16:32:43 +01:00
\begin{tikzpicture}
\pgfmathsetmacro{\xdist}{8.5}
\pgfmathsetmacro{\ydist}{4.5}
\foreach \xval in {1,2}
{
\foreach \yval in {1,2,...,6}
2016-05-02 16:32:43 +01:00
{
2016-07-27 21:46:38 +01:00
\node at (\xval*\xdist,\yval*\ydist) {\therionprotract};
2016-05-02 16:32:43 +01:00
}
}
\end{tikzpicture}
\end{figure}
\end{document}