# Example: Belt and pulley system

Published 2012-03-25 | Author: Jimi Oke

This simple belt-and-pulley is used as a basis for solving trigonometric problems. Although simplistic, it shows how elegant and powerful TikZ can be for mathematically precise illustrations. Diagram from Precalculus text by Stewart.

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.

% Belt and pulley system
% Author: Jimi Oke
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}
\begin{document}
\begin{tikzpicture}

% Definitions
\pgfmathsetmacro{\b}{75}
\pgfmathsetmacro{\a}{15}
\pgfmathsetmacro{\R}{2}
\pgfmathsetmacro{\r}{1}
\pgfmathsetmacro{\P}{\R*tan(\b)}
\pgfmathsetmacro{\Q}{\R/cos(\b)}
\pgfmathsetmacro{\p}{\r/tan(\a)}
\pgfmathsetmacro{\q}{\r/sin(\a)}

% Pulleys

% big pulley
\draw (0,0) circle (\R) ;
\fill[left color=gray!80, right color=gray!60, middle
color=white] (0,0) circle (\R) ;
\draw[thick, white] (0,0) circle (.8*\R);
\shade[ball color=white] (0,0) circle (.3) node[left,xshift=-5] {$P$};

% small pulley
\draw (\Q+\q-.3, 0) circle (\r);
\fill[left color=gray!80, right color=gray!60, middle
color=white] (\Q+\q-.3, 0) circle (\r) ;
\draw[thick, white] (\Q+\q-.3,0) circle (.8*\r);
node[right, xshift=2] {$Q$};

% belt and point labels
\begin{scope}[ultra thick]
\draw (\b:\R) arc (\b:360-\b:\R) ;
\draw (\b:\R) -- ( \P, 0 );
\draw (-\b:\R) -- ( \P, 0 );
\draw (\Q-.3,0) -- + (\a:\p)  arc (105:-105:\r) ;
\draw (\Q-.3,0) -- + (-\a:\p);
%\draw (\b:\R) arc (\b:360-\b:\r) ;
\end{scope}

\draw (0,0) -- (\b:\R) node[midway, above,sloped] {$R$} node[above] {$A$};
\draw (-\b:\R)--(0,0) ;
\draw (\Q+\q-.3,0) -- +(105:\r) node[midway,above, sloped] {$r$}
node[above] {$E$};
\draw (\Q+\q-.3,0) -- +(-105:\r) node[below] {$D$};
\node[below] at (-\b:\R) {$B$};
\node[below] at (\Q-.3,0) {$C$};

% center line
\draw[dash pattern=on5pt off3pt] (0,0) -- (\Q+\q-.3,0);

% angle label
\node[fill=white] at (0.73*\Q, 0) {$\theta$} ;
\draw (\Q-1.8,0) arc (180:195:1.5);
\draw (\Q-1.8,0) arc (180:165:1.5);
\end{tikzpicture}
\end{document}


• #1 Volker Grabsch, June 26, 2012 at 10:19 p.m.

Could anyone remove that nasty spam comment #1, please?

(When done, feel free to remove this comment here, too)

• #2 john, April 12, 2013 at 10:43 a.m.

Wow that was strange. I just wrote an extremely long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Regardless, just wanted to say wonderful blog!

• #3 anna, April 17, 2013 at 4:42 a.m.

Unquestionably believe that which you stated. Your favorite reason seemed to be on the internet the easiest thing to be aware of. I say to you, I definitely get irked while people consider worries that they just do not know about. You managed to hit the nail upon the top and defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks