Belt and pulley system

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.


belt-pulley

Edit and compile if you like:

% Belt and pulley system
% Author: Jimi Oke
\documentclass[11pt]{article}
\usepackage{tikz}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
\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);
\shade[ball color=white] (\Q+\q-.3,0) circle (.15)
node[right, xshift=2] {$Q$};
% belt and point labels
\begin{scope}[ultra thick]
\draw (\b:\R) arc (\b:360-\b:\R) ;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Click to download: belt-pulley.texbelt-pulley.pdf
Open in Overleaf: belt-pulley.tex