%% mechanics-pulley-string-variants.tex
%% Tangency remains exact as endpoints, pulley size, and wrap choice change.

\documentclass[tikz,border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{tikzphysics.mechanics}

\begin{document}
\begin{tikzpicture}[font=\small]
  %% Left-to-right string over the pulley.
  \coordinate (A1) at (-2.5,-1.1);
  \coordinate (B1) at ( 2.5,-1.1);
  \node[pulley,pulley diameter=1] (P1) at (0,0) {};
  \physicsstringoverpulley[string route=over]{A1}{P1}{B1}
  \fill (A1) circle (1pt) (B1) circle (1pt);
  \node[below=3pt] at (0,-1.1) {over route};

  %% The complementary lower-contact route.
  \begin{scope}[xshift=6cm]
    \coordinate (A2) at (-2.5,1.1);
    \coordinate (B2) at ( 2.5,1.1);
    \node[pulley,pulley diameter=1] (P2) at (0,0) {};
    \physicsstringoverpulley[string route=under]{A2}{P2}{B2}
    \fill (A2) circle (1pt) (B2) circle (1pt);
    \node[above=3pt] at (0,1.1) {under route};
  \end{scope}

  %% Horizontal-to-hanging quarter turn.
  \begin{scope}[xshift=12cm]
    \coordinate (A3) at (-2.4,-0.6);
    \coordinate (B3) at (0.5,-2.3);
    \node[pulley,pulley diameter=1] (P3) at (0,0) {};
    \physicsstringoverpulley{A3}{P3}{B3}
    \fill (A3) circle (1pt) (B3) circle (1pt);
    \node[below=3pt] at (0,-2.3) {quarter turn};
  \end{scope}

  %% Endpoints below and to the same side of the pulley.
  \begin{scope}[yshift=-4.5cm]
    \coordinate (A4) at (-2.4,-1.8);
    \coordinate (B4) at (-1.1,-2.7);
    \node[pulley,pulley diameter=1.25] (P4) at (0,0) {};
    \physicsstringoverpulley[
      string start solution=2,
      string end solution=1,
      string wrap=shortest]{A4}{P4}{B4}
    \fill (A4) circle (1pt) (B4) circle (1pt);
    \node[below=3pt] at (-1.4,-2.7) {same-side endpoints};
  \end{scope}

  %% Unequal heights and distances: no compass anchor is assumed.
  \begin{scope}[xshift=6cm,yshift=-4.5cm]
    \coordinate (A5) at (-2.4,0.3);
    \coordinate (B5) at ( 1.8,-1.9);
    \node[pulley,pulley diameter=0.8] (P5) at (0,0) {};
    \physicsstringoverpulley[string route=shortest]{A5}{P5}{B5}
    \fill (A5) circle (1pt) (B5) circle (1pt);
    \node[below=3pt] at (0,-1.9) {unequal endpoints};
  \end{scope}

  %% Reversing the endpoint order uses the complementary tangent choices.
  \begin{scope}[xshift=12cm,yshift=-4.5cm]
    \coordinate (A6) at ( 2.5,-1.1);
    \coordinate (B6) at (-2.5,-1.1);
    \node[pulley,pulley diameter=1] (P6) at (0,0) {};
    \physicsstringoverpulley[
      string start solution=1,
      string end solution=2,
      string wrap=counterclockwise]{A6}{P6}{B6}
    \fill (A6) circle (1pt) (B6) circle (1pt);
    \node[below=3pt] at (0,-1.1) {reversed endpoints};
  \end{scope}
\end{tikzpicture}
\end{document}
