# Rømer wheels in TikZ - wrong length of the spiral arc?

I'm trying to draw a pair of so called Rømer wheels:

These are two logarithmic spirals rolling on each other, one clockwise and the other counterclockwise, but my equation for rotation angle of the second wheel by given angle of the first wheel seem to be wrong (I'm using polar coordinates).

Here is the TikZ code:

\documentclass[12pt, border=0.5mm]{standalone}
\usepackage{tikz}
\usepackage{fp}
\usetikzlibrary{fixedpointarithmetic}

\begin{document}

\begin{tikzpicture}[x=1mm, y=1mm]

\draw[line cap=round, line width=0.2mm, domain=0:2*pi, variable=\t, samples=100, yshift=8.0072mm, rotate around={-100:(0,0)}]
plot[fixed point arithmetic] ({\t r}:{1.2*exp(0.4*\t)}) -- cycle;

\draw[line cap=round, line width=0.2mm, domain=0:2*pi, variable=\t, samples=100, yshift=-8.0072mm, rotate around={90.6709:(0,0)}]
plot[fixed point arithmetic] ({\t r}:{1.2*exp(0.4*\t)}) -- cycle;

\end{tikzpicture}

\end{document}


and the output:

• You don't seem to use the formula you have given as an image. What are r values? And can you complete your MWE with the necessary libraries etc. – percusse Aug 16 '15 at 13:25
• What's the relation between the function you've given in terms of sin and the function you are using to draw the wheels? Even the number of variables seems to differ. – cfr Aug 16 '15 at 14:20
• Is your curve the same as Fibonacci spiral? texample.net/tikz/examples/fibonacci-spiral – Sigur Aug 16 '15 at 14:23
• And what is the desired output? The one in the attached image? – Gonzalo Medina Aug 16 '15 at 19:24

Use length as the parameter. And then ln it.

\documentclass[border=9,tikz]{standalone}
\begin{document}
\def\n{30}\def\.{.71828}
\foreach\r in{1,...,\n}{
\pgfmathsetmacro\s{1+\r*1\./\n}
\tikz{
\fill[black](-3,-3)rectangle(3,6\.);
\draw[white,line cap=round,domain=1:2\.,variable=\t,samples=100]
plot[shift={(0,3\.)},rotate={-360*ln(    \s)-90}]({360*ln(    \t)}:{    \t})--cycle
plot[shift={(0,  0)},rotate={-360*ln(3\.-\s)+90}]({360*ln(3\.-\t)}:{3\.-\t})--cycle;
}
}
\end{document}


• Thank you, looks great. I'll try to figure out that does every single parameter mean :) – GeMir Aug 17 '15 at 20:01

Here is my solution:

\begin{tikzpicture}[x=1mm, y=1mm]

\def\l{3.25};

\def\a{1.2*pi};

% Second parameter of the spiral
\def\b{0.25}

\begin{scope}[rotate=-90]

\pgfmathsetmacro{\shift}{{\l*exp(\b*2*pi)+\l}}
\pgfmathsetmacro{\angle}{ln((\shift - \l*exp(\b*\a))/\l)/\b}

% Spiral (bottom)
\begin{scope}[rotate around={{180-deg(\angle)}:(0, 0)}]
\draw[line width=0.075mm, domain=0:2*pi, variable=\t, samples=500]
plot[fixed point arithmetic] ({\l*exp(\b*\t)*cos(deg(\t))}, {\l*exp(\b*\t)*sin(deg(\t))}) -- cycle;
\end{scope}

% Spiral (top)
\begin{scope}[rotate around={{-deg(\a)}:(-\shift, 0)}]
\draw[line width=0.075mm, domain=0:2*pi, variable=\t, samples=500]
plot[fixed point arithmetic] ({-\shift + \l*exp(\b*\t)*cos(deg(\t))}, {\l*exp(\b*\t)*sin(deg(\t))}) -- cycle;
\end{scope}
\end{scope}
\end{tikzpicture}