%% tikzphysics.tex -- user manual for tikzphysics 1.0.0
\documentclass[11pt]{article}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper,margin=22mm,headheight=14pt]{geometry}
\usepackage{microtype}
\usepackage{parskip}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{array}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{tikzphysics}

\definecolor{physicsblue}{HTML}{1E4E79}
\definecolor{physicsteal}{HTML}{0B6E69}
\definecolor{physicssoft}{HTML}{F2F6F8}
\definecolor{physicscode}{HTML}{263238}
\definecolor{physicsgray}{HTML}{5E6A71}

\hypersetup{
  colorlinks=true,
  linkcolor=physicsblue,
  urlcolor=physicsteal,
  pdftitle={tikzphysics - TikZ-native physics diagrams},
  pdfauthor={Vaibhav Blayer},
  pdfsubject={User manual for tikzphysics 1.0.0},
  pdfkeywords={LaTeX, TikZ, physics, diagrams, mechanics, optics},
}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\textcolor{physicsgray}{\texttt{tikzphysics} 1.0.0}}
\fancyhead[R]{\textcolor{physicsgray}{User manual}}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.3pt}

\setlist{nosep,leftmargin=*}
\setcounter{tocdepth}{2}
\setlength{\emergencystretch}{2em}

\lstdefinestyle{physicslatex}{
  language=[LaTeX]TeX,
  basicstyle=\small\ttfamily\color{physicscode},
  backgroundcolor=\color{physicssoft},
  frame=single,
  rulecolor=\color{physicsblue!25},
  framesep=6pt,
  xleftmargin=3pt,
  xrightmargin=3pt,
  columns=fullflexible,
  keepspaces=true,
  breaklines=true,
  showstringspaces=false,
}

\newcommand{\key}[1]{\texttt{#1}}
\newcommand{\sty}[1]{\texttt{#1}}
\newcommand{\module}[1]{\texttt{tikzphysics.#1}}
\newcommand{\physicsnote}[1]{%
  \par\smallskip
  \noindent\colorbox{physicssoft}{%
    \parbox{\dimexpr\linewidth-2\fboxsep\relax}{\textcolor{physicsblue}{\textbf{Note.}} #1}}%
  \par\smallskip
}

\newcolumntype{K}{>{\ttfamily\raggedright\arraybackslash}p{0.31\linewidth}}
\newcolumntype{D}{>{\raggedright\arraybackslash}X}

\title{%
  \vspace{-1.5cm}
  {\Huge\bfseries\textcolor{physicsblue}{\texttt{tikzphysics}}}\\[5pt]
  {\Large TikZ-native physics diagrams}\\[12pt]
  {\large Version 1.0.0}}
\author{Vaibhav Blayer\\\href{mailto:vaibhavblayer@gmail.com}{vaibhavblayer@gmail.com}}
\date{2026-08-12}

\begin{document}
\maketitle

\begin{abstract}
\noindent
\texttt{tikzphysics} extends TikZ with reusable shapes and geometric anchors for
classical-physics diagrams. It provides continuous contact surfaces, inclined
planes, blocks, pulleys, and a curved optical lens without introducing a new
drawing language. Every object remains an ordinary TikZ node or path.
\end{abstract}

\noindent\colorbox{physicssoft}{%
  \parbox{\dimexpr\linewidth-2\fboxsep\relax}{%
    \textbf{In one line:}
    \key{\textbackslash node[physicswedge, physics wedge angle=30,
    physics wedge width=6] (W) at (0,0) \{\};}}}

\tableofcontents
\clearpage

% -----------------------------------------------------------------------------
\section{Start here}

\subsection{Loading}

Load every module with the package wrapper:

\begin{lstlisting}[style=physicslatex]
\usepackage{tikzphysics}
\end{lstlisting}

For smaller documents, load only the required TikZ libraries:

\begin{lstlisting}[style=physicslatex]
\usepackage{tikz}
\usetikzlibrary{tikzphysics.surface, tikzphysics.mechanics}
\end{lstlisting}

The available libraries are \module{surface}, \module{mechanics},
\module{optics}, and \module{core}. Each feature library loads
\module{core} automatically.

\subsection{The design model}

\begin{enumerate}
  \item Choose a style such as \sty{physicswedge}, \sty{physicsblock}, or
        \sty{physicslens}.
  \item Set dimensions and geometry with keys whose names begin with
        \key{physics}.
  \item Give the node a name and compose the diagram through its anchors.
\end{enumerate}

\begin{lstlisting}[style=physicslatex]
\begin{tikzpicture}
  \node[physicswedge, physics wedge width=5, physics wedge angle=30] (W) at (0,0) {};
  \node[physicsblock, physics block width=0.9, physics block height=0.7,
        rotate=30, anchor=south] at (W.slope-mid) {$m$};
\end{tikzpicture}
\end{lstlisting}

\begin{center}
\begin{tikzpicture}
  \node[physicswedge, physics wedge width=5, physics wedge angle=30] (W) at (0,0) {};
  \node[physicsblock, physics block width=0.9, physics block height=0.7,
        rotate=30, anchor=south] at (W.slope-mid) {$m$};
\end{tikzpicture}
\end{center}

\subsection{Dimensions}

All public size keys accept either a bare value or an explicit TeX dimension.
A bare value is interpreted as centimetres, so \key{physics wedge width=4} and
\key{physics wedge width=4cm} are equivalent. Values such as \key{12mm},
\key{18pt}, and \key{1in} retain their units. Sizes must be positive.

% -----------------------------------------------------------------------------
\section{Contact surfaces and wedges}

\subsection{Bent platforms}

The three platform styles share a horizontal floor strip. The left and right
variants extend that strip through one bent wall; the both variant has two
independently configurable bends. Each node is rendered as one continuous
platform, without a hinge mark or seam. Wall direction is continuous rather
than limited to presets, so the gallery below covers every distinct
configuration class; intermediate angles use the same keys.

\begin{tabularx}{\linewidth}{@{}KD@{}}
\toprule
Style & Configuration \\
\midrule
physicsplatform-left & One wall at the left floor corner. \\
physicsplatform-right & One wall at the right floor corner. \\
physicsplatform-both & Two walls; set both with \key{physics wall angle}, or set them
  independently with \key{physics left wall angle} and
  \key{physics right wall angle}. \\
\bottomrule
\end{tabularx}

\subsubsection*{Variant gallery}

\begin{center}
\begin{tikzpicture}[font=\scriptsize]
  % Row 1: vertical variants
  \node[physicsplatform-left, physics platform width=2.2, physics platform depth=1,
        physics wall angle=-90, anchor=floor-top-mid] at (0,0) {};
  \node[align=center] at (0,-1.45) {down left\\\key{-90}};
  \node[physicsplatform-right, physics platform width=2.2, physics platform depth=1,
        physics wall angle=-90, anchor=floor-top-mid] at (3.8,0) {};
  \node[align=center] at (3.8,-1.45) {down right\\\key{-90}};
  \node[physicsplatform-both, physics platform width=2.2, physics platform depth=1,
        physics wall angle=-90, anchor=floor-top-mid] at (7.6,0) {};
  \node[align=center] at (7.6,-1.45) {down both\\\key{-90/-90}};
  \node[physicsplatform-both, physics platform width=2.2, physics platform depth=1,
        physics wall angle=90, anchor=floor-top-mid] at (11.4,0) {};
  \node[align=center] at (11.4,-1.45) {up both\\\key{90/90}};

  % Row 2: sloped variants
  \node[physicsplatform-left, physics platform width=2.2, physics platform depth=1,
        physics wall angle=135, anchor=floor-top-mid] at (0,-3) {};
  \node[align=center] at (0,-4.45) {outward left\\\key{135}};
  \node[physicsplatform-right, physics platform width=2.2, physics platform depth=1,
        physics wall angle=45, anchor=floor-top-mid] at (3.8,-3) {};
  \node[align=center] at (3.8,-4.45) {outward right\\\key{45}};
  \node[physicsplatform-both, physics platform width=2.2, physics platform depth=1,
        physics left wall angle=135, physics right wall angle=45,
        anchor=floor-top-mid] at (7.6,-3) {};
  \node[align=center] at (7.6,-4.45) {outward both\\\key{135/45}};
  \node[physicsplatform-both, physics platform width=2.2, physics platform depth=1,
        physics left wall angle=45, physics right wall angle=135,
        anchor=floor-top-mid] at (11.4,-3) {};
  \node[align=center] at (11.4,-4.45) {inward both\\\key{45/135}};

  % Row 3: straight and independently angled variants
  \node[physicsplatform-left, physics platform width=2.2, physics platform depth=1,
        physics wall angle=180, anchor=floor-top-mid] at (0,-6) {};
  \node[align=center] at (0,-7.45) {straight left\\\key{180}};
  \node[physicsplatform-right, physics platform width=2.2, physics platform depth=1,
        physics wall angle=0, anchor=floor-top-mid] at (3.8,-6) {};
  \node[align=center] at (3.8,-7.45) {straight right\\\key{0}};
  \node[physicsplatform-both, physics platform width=2.2, physics platform depth=1,
        physics left wall angle=180, physics right wall angle=0,
        anchor=floor-top-mid] at (7.6,-6) {};
  \node[align=center] at (7.6,-7.45) {straight both\\\key{180/0}};
  \node[physicsplatform-both, physics platform width=2.2, physics platform depth=1,
        physics left wall angle=120, physics right wall angle=-35,
        anchor=floor-top-mid] at (11.4,-6) {};
  \node[align=center] at (11.4,-7.45) {asymmetric\\\key{120/-35}};
\end{tikzpicture}
\end{center}

\begin{tabularx}{\linewidth}{@{}KD@{}}
\toprule
Key & Meaning and default \\
\midrule
physics platform width & Overall floor width; default \texttt{5cm}. \\
physics platform depth & Wall length and nominal vertical extent; default
  \texttt{2cm}. \\
physics strip width & Thickness of the floor and walls; default \texttt{0.3cm}. \\
physics wall angle & Direction of every wall, measured counter-clockwise from the
  positive x-axis; default \texttt{-90}. \\
physics left wall angle & Left-wall override for \sty{physicsplatform-both}. \\
physics right wall angle & Right-wall override for \sty{physicsplatform-both}. \\
\bottomrule
\end{tabularx}

\clearpage
\subsubsection*{Key-by-key variants}

Each public platform key can be varied independently and combined with any
configuration from the preceding gallery. These examples isolate the visual
effect of all six keys.

\begin{center}
\begin{tikzpicture}[font=\scriptsize]
  % Row 1: dimensions
  \node[physicsplatform-both, physics platform width=3.8, physics platform depth=0.8,
        anchor=floor-top-mid] at (0,0) {};
  \node[align=center] at (0,-1.85)
    {wide floor\\\key{physics platform width=3.8}};
  \node[physicsplatform-both, physics platform width=2.5, physics platform depth=1.5,
        anchor=floor-top-mid] at (5.2,0) {};
  \node[align=center] at (5.2,-1.85)
    {deep walls\\\key{physics platform depth=1.5}};
  \node[physicsplatform-both, physics platform width=2.8, physics platform depth=1,
        physics strip width=0.5, anchor=floor-top-mid] at (10.4,0) {};
  \node[align=center] at (10.4,-1.85)
    {thick material\\\key{physics strip width=0.5}};

  % Row 2: shared and independent directions
  \node[physicsplatform-both, physics platform width=2.6, physics platform depth=1.1,
        physics wall angle=70, anchor=floor-top-mid] at (0,-4) {};
  \node[align=center] at (0,-5.65)
    {shared direction\\\key{physics wall angle=70}};
  \node[physicsplatform-both, physics platform width=2.6, physics platform depth=1.1,
        physics left wall angle=135, physics right wall angle=-90,
        anchor=floor-top-mid] at (5.2,-4) {};
  \node[align=center] at (5.2,-5.65)
    {left override\\\key{physics left wall angle=135}};
  \node[physicsplatform-both, physics platform width=2.6, physics platform depth=1.1,
        physics left wall angle=-90, physics right wall angle=45,
        anchor=floor-top-mid] at (10.4,-4) {};
  \node[align=center] at (10.4,-5.65)
    {right override\\\key{physics right wall angle=45}};
\end{tikzpicture}
\end{center}

The floor and wall contact lines meet at a fixed \key{corner}. The complete
floor-and-wall body is one closed polygon: its outer contact line and inner
edge both meet in exact, sharp V-shaped miters. The two-wall style exposes
\key{left-corner} and \key{right-corner}; these lie on the same continuous
geometry rather than on separately assembled parts. Angles may vary
continuously; only a left wall at $0^\circ$ and a right wall at $180^\circ$
(modulo $360^\circ$) are excluded because they retrace the floor and have no
finite miter.

\begin{center}
\begin{tikzpicture}[font=\small]
  \node[physicsplatform-left, physics platform width=5, physics platform depth=2.2,
        physics wall angle=125, anchor=corner] (P) at (0,0) {};
  \draw[physicsblue,very thick]
    (P.wall-outer-55) -- (P.corner) -- (P.floor-top-25);
  \fill[physicsblue] (P.corner) circle (1.5pt);
  \node[physicsblue,below left=2pt] at (P.corner) {fixed \key{corner}};
  \fill[physicsteal] (P.floor-top-25) circle (1.2pt);
  \node[physicsteal,above=2pt] at (P.floor-top-25) {\key{floor-top-25}};
\end{tikzpicture}
\end{center}

\subsubsection*{Platform anchors}

\begin{tabularx}{\linewidth}{@{}KD@{}}
\toprule
Family & Available anchors \\
\midrule
Surface corner & \key{corner}; for the two-wall style, \key{left-corner} and
  \key{right-corner}. \\
Floor corners & \key{floor-tl}, \key{floor-tr}, \key{floor-br},
  \key{floor-bl}. \\
Floor midpoints & \key{floor-top-mid}, \key{floor-bottom-mid},
  \key{floor-left-mid}, \key{floor-right-mid}, \key{floor-center}. \\
Wall corners & \key{wall-A}, \key{wall-B}, \key{wall-C}, \key{wall-D},
  ordered as outer-near, inner-miter, inner-far, outer-far. \\
Wall midpoints & \key{wall-outer-mid}, \key{wall-inner-mid},
  \key{wall-near-mid}, \key{wall-far-mid}, \key{wall-center}. \\
Two-wall prefixes & Use \key{left-wall-...} and \key{right-wall-...} for
  wall corners, midpoints, and numeric wall edges. \\
\bottomrule
\end{tabularx}

Every floor and wall edge also provides integer anchors from 0 through 100,
for example \key{floor-top-25}, \key{wall-outer-50}, and
\key{right-wall-inner-75}.

\clearpage
\subsection{Wedges}

\sty{physicswedge} creates a right triangle for inclined-plane diagrams.

\begin{center}
\begin{tikzpicture}[font=\footnotesize]
  \node[physicswedge, physics wedge width=3.2, physics wedge angle=32] (A) at (0,0) {};
  \node[below=3pt] at (A.base-mid) {right angle at \key{br}};

  \node[physicswedge, physics wedge width=3.2, physics wedge angle=40,
        physics wedge right angle at=bl] (B) at (4.4,0) {};
  \node[below=3pt] at (B.base-mid) {right angle at \key{bl}};

  \node[physicswedge, physics wedge width=3.2,
        physics wedge right angle at=top] (C) at (8.8,0) {};
  \node[below=3pt] at (C.base-mid) {right angle at \key{top}};
\end{tikzpicture}
\end{center}

\begin{tabularx}{\linewidth}{@{}KD@{}}
\toprule
Key & Meaning and default \\
\midrule
physics wedge width & Base width; default \texttt{4cm}. \\
physics wedge height & Explicit height when no angle is supplied. \\
physics wedge angle & Authoritative acute angle; default is 30 degrees for
  \key{bl}/\key{br}, and 45 degrees for \key{top}. \\
physics wedge right angle at & One of \key{br} (default), \key{bl}, or
  \key{top}. \\
\bottomrule
\end{tabularx}

Geometry precedence is \key{physics wedge angle}, then \key{physics wedge height}, then
the mode default. The principal anchors are \key{bl}, \key{br}, \key{top},
\key{base-mid}, \key{right-mid}, \key{slope-mid},
\key{slope-right-mid}, and \key{centroid}. Numeric edge families are
\key{base-0..100}, \key{right-0..100}, and \key{slope-0..100}.

\subsection{Ground, ceiling, and walls}

\begin{center}
\begin{tikzpicture}[font=\footnotesize]
  \node[physicsground, physics ground width=3.3] (G) at (0,0) {};
  \node[below=3pt] at (G.bottom-mid) {\sty{physicsground}};
  \node[physicsceiling, physics ceiling width=3.3] (C) at (4.7,0) {};
  \node[above=3pt] at (C.top-mid) {\sty{physicsceiling}};
  \node[physicswall-left, physics wall height=1.7] (WL) at (8.2,0) {};
  \node[left=4pt] at (WL.left-mid) {\sty{physicswall-left}};
  \node[physicswall-right, physics wall height=1.7] (WR) at (10.2,0) {};
  \node[right=4pt] at (WR.right-mid) {\sty{physicswall-right}};
\end{tikzpicture}
\end{center}

The sizing keys are grouped by shape:

\begin{center}
\begin{tabular}{@{}ll@{}}
\sty{physicsground} & \key{physics ground width}, \key{physics ground depth} \\
\sty{physicsceiling} & \key{physics ceiling width}, \key{physics ceiling depth} \\
\sty{physicswall-left}, \sty{physicswall-right} & \key{physics wall thickness},
  \key{physics wall height}
\end{tabular}
\end{center}

Each shape exposes four corners, four edge midpoints, \key{center}, and
\key{surface}, plus numeric \key{top/right/bottom/left-0..100} edge anchors.

% -----------------------------------------------------------------------------
\section{Blocks and pulleys}

The \module{mechanics} library supplies thin styles over TikZ's rectangle and
circle shapes. Both styles retain the standard rectangle/circle compass
anchors.

\begin{center}
\begin{tikzpicture}[scale=0.78, every node/.append style={transform shape}]
  \node[physicswedge, physics wedge width=5.2, physics wedge angle=30] (W) at (0,0) {};
  \node[physicsblock, physics block width=0.8, physics block height=0.8,
        rotate=30, anchor=south] (B) at (W.slope-mid) {$m$};
  \coordinate (pulley-center) at ($(W.top)+(30:0.5)+(120:0.125)$);
  \node[physicspulley, physics pulley diameter=0.55] (P) at (pulley-center) {};
  \node[physicsblock, physics block width=0.7, physics block height=0.7]
    (H) at ($(P.east)+(0,-2.1)$) {$M$};
  \physicsstringoverpulley{B.east}{P}{H.north}
\end{tikzpicture}
\end{center}

\key{\textbackslash physicsstringoverpulley\{start\}\{pulley\}\{end\}}
draws a single physical string. Both straight portions meet the circular
pulley tangentially, and the intervening portion follows the pulley arc. The
default \key{surface-right} route matches the layout shown above: the pulley
is just beyond the incline's right end, the first string portion is parallel
to the slope, the contact arc passes over the upper rim, and the second
portion descends vertically on the right.

\subsection{String-routing variants}

The endpoint coordinates may be placed at any unequal positions outside the
pulley. The named routes below include two common left-to-right wraps and the
default surface-to-right-hanging turn. \key{shortest} keeps the selected
tangent pair and chooses the shorter contact arc. For other endpoint
orderings, select tangent solutions and wrap direction explicitly.

\begin{center}
\begin{tikzpicture}[font=\scriptsize]
  \begin{scope}
    \coordinate (RA) at (-1.5,-0.7);
    \coordinate (RB) at ( 1.5,-0.7);
    \node[physicspulley,physics pulley diameter=0.7] (RP) at (0,0) {};
    \physicsstringoverpulley[physics string route=over]{RA}{RP}{RB}
    \node at (0,-1.25) {\key{over}};
  \end{scope}
  \begin{scope}[xshift=4.1cm]
    \coordinate (RA) at (-1.5,0.7);
    \coordinate (RB) at ( 1.5,0.7);
    \node[physicspulley,physics pulley diameter=0.7] (RP) at (0,0) {};
    \physicsstringoverpulley[physics string route=under]{RA}{RP}{RB}
    \node at (0,-1.25) {\key{under}};
  \end{scope}
  \begin{scope}[xshift=8.2cm]
    \coordinate (RA) at (-1.5,-0.45);
    \coordinate (RB) at (0.35,-1.45);
    \node[physicspulley,physics pulley diameter=0.7] (RP) at (0,0) {};
    \physicsstringoverpulley{RA}{RP}{RB}
    \node at (0,-1.9) {\key{surface-right}};
  \end{scope}
  \begin{scope}[xshift=12.3cm]
    \coordinate (RA) at (-1.5,0.25);
    \coordinate (RB) at ( 1.25,-1.1);
    \node[physicspulley,physics pulley diameter=0.7] (RP) at (0,0) {};
    \physicsstringoverpulley[physics string route=shortest]{RA}{RP}{RB}
    \node at (0,-1.55) {unequal endpoints};
  \end{scope}
\end{tikzpicture}
\end{center}

\begin{tabularx}{\linewidth}{@{}KD@{}}
\toprule
Key & Meaning and default \\
\midrule
physics block width & Block width; default \texttt{1cm}. \\
physics block height & Block height; default \texttt{1cm}. \\
physics pulley diameter & Pulley diameter; default \texttt{1cm}. \\
physics pulley axle radius & Axle-dot radius; default \texttt{2pt}. Use
  \key{none} to hide the dot. \\
physics pulley axle color & Axle-dot colour; default \texttt{black}. \\
physics string start solution & Start-side tangent, \texttt{1} or \texttt{2};
  default \texttt{2}. \\
physics string end solution & End-side tangent, \texttt{1} or \texttt{2};
  default \texttt{1}. \\
physics string route & \texttt{surface-right} (default), \texttt{over},
  \texttt{under}, or \texttt{shortest}. \\
physics string wrap & \texttt{clockwise} (default), \texttt{counterclockwise},
  or \texttt{shortest}. \\
\bottomrule
\end{tabularx}

\clearpage
\subsection{Complete pulley systems}

The mechanics shapes compose directly with every surface family. In each
diagram below, one call to \key{\textbackslash physicsstringoverpulley} draws both
straight tangent portions and the circular contact arc; no pulley compass
anchor is used as a substitute for the contact point.

\noindent
\begin{minipage}[t]{0.48\linewidth}
\centering
\begin{tikzpicture}[scale=0.72,every node/.append style={transform shape}]
  \node[physicsground, physics ground width=5.6, physics ground depth=0.35] (G) at (0,0) {};
  \node[physicsblock, physics block width=0.9, physics block height=0.8,
        anchor=south] (B) at (G.top-30) {$m_1$};
  \coordinate (mount) at ($(G.top-right)+(0.4,0.05)$);
  \draw (G.top-right) -- (mount);
  \node[physicspulley, physics pulley diameter=0.7] (P) at (mount) {};
  \node[physicsblock, physics block width=0.75, physics block height=0.75]
    (H) at ($(P.east)+(0,-2.1)$) {$m_2$};
  \physicsstringoverpulley{B.east}{P}{H.north}
\end{tikzpicture}

\smallskip\textbf{Horizontal plane}
\end{minipage}\hfill
\begin{minipage}[t]{0.48\linewidth}
\centering
\begin{tikzpicture}[scale=0.72,every node/.append style={transform shape}]
  \node[physicswedge, physics wedge width=5, physics wedge angle=30] (W) at (0,0) {};
  \node[physicsblock, physics block width=0.9, physics block height=0.8,
        rotate=30, anchor=south] (B) at (W.slope-mid) {$m_1$};
  \coordinate (mount) at ($(W.top)+(30:0.5)+(120:0.075)$);
  \node[physicspulley, physics pulley diameter=0.65] (P) at (mount) {};
  \node[physicsblock, physics block width=0.75, physics block height=0.75]
    (H) at ($(P.east)+(0,-2.2)$) {$m_2$};
  \physicsstringoverpulley{B.east}{P}{H.north}
\end{tikzpicture}

\smallskip\textbf{Inclined plane}
\end{minipage}

\vspace{1.2em}
\noindent
\begin{minipage}[t]{0.48\linewidth}
\centering
\begin{tikzpicture}[scale=0.72,every node/.append style={transform shape}]
  \node[physicsplatform-right, physics platform width=4.6, physics platform depth=1.9,
        physics strip width=0.28, physics wall angle=42,
        anchor=floor-top-mid] (S) at (0,0) {};
  \node[physicsblock, physics block width=0.85, physics block height=0.75,
        rotate=42, anchor=south]
    (B) at (S.wall-outer-42) {$m_1$};
  \coordinate (mount) at ($(S.wall-outer-100)+(42:0.5)+(132:0.025)$);
  \draw (S.wall-outer-100) -- (mount);
  \node[physicspulley, physics pulley diameter=0.7] (P) at (mount) {};
  \node[physicsblock, physics block width=0.75, physics block height=0.75]
    (H) at ($(P.east)+(0,-2.1)$) {$m_2$};
  \physicsstringoverpulley{B.east}{P}{H.north}
\end{tikzpicture}

\smallskip\textbf{Continuous bent platform}
\end{minipage}\hfill
\begin{minipage}[t]{0.48\linewidth}
\centering
\begin{tikzpicture}[scale=0.72,every node/.append style={transform shape}]
  \node[physicsceiling, physics ceiling width=3.2, physics ceiling depth=0.3]
    (C) at (0,0) {};
  \draw (C.surface) -- ++(0,-0.5) coordinate (mount);
  \node[physicspulley, physics pulley diameter=0.85] (P) at (mount) {};
  \node[physicsblock, physics block width=0.75, physics block height=0.75]
    (L) at ($(P.west)+(0,-2.1)$) {$m_1$};
  \node[physicsblock, physics block width=0.75, physics block height=0.75]
    (R) at ($(P.east)+(0,-2.7)$) {$m_2$};
  \physicsstringoverpulley[physics string route=over]{L.north}{P}{R.north}
\end{tikzpicture}

\smallskip\textbf{Two hanging masses}
\end{minipage}

\medskip
Copy-ready standalone sources are included in the \key{examples} directory:

\begin{itemize}
  \item \path{mechanics-pulley-flat-plane.tex} and
    \path{mechanics-block-pulley.tex};
  \item \path{mechanics-pulley-bent-platform.tex} and
    \path{mechanics-pulley-two-masses.tex};
  \item \path{mechanics-pulley-string-variants.tex}, a gallery of six endpoint
    and wrapping arrangements.
\end{itemize}

\clearpage
% -----------------------------------------------------------------------------
\section{Optical lens}

\sty{physicslens} draws a curved element between two circular arcs. Its node centre
lies halfway between the on-axis front and back vertices.

\begin{center}
\begin{tikzpicture}[font=\footnotesize]
  \draw[->,physicsgray] (-3.6,0) -- (3.6,0) node[right] {principal axis};
  \node[physicslens, physics lens radius=5, physics lens thickness=0.25,
        physics lens aperture angle=30] (L) at (0,0) {};
  \foreach \a/\pos in {front-25/left,front-75/left,back-mid/right} {
    \fill[physicsblue] (L.\a) circle (1.2pt);
    \node[physicsblue,\pos=3pt] at (L.\a) {\key{\a}};
  }
\end{tikzpicture}
\end{center}

\begin{tabularx}{\linewidth}{@{}KD@{}}
\toprule
Key & Meaning and default \\
\midrule
physics lens radius & Radius of the front optical surface; default \texttt{5cm}. \\
physics lens thickness & On-axis separation of the two surfaces; default
  \texttt{0.25cm}. \\
physics lens aperture angle & Front-arc half-angle; default 30 degrees. The value
  must be strictly between 0 and 90 degrees. \\
\bottomrule
\end{tabularx}

Named anchors include \key{vertex}, \key{front-mid}, \key{back-mid},
\key{front-top}, \key{front-bottom}, \key{back-top}, \key{back-bottom},
\key{top}, and \key{bottom}. The arc families \key{front-0..100} and
\key{back-0..100} run from bottom to top.

% -----------------------------------------------------------------------------
\section{Shared tools}

\subsection{Parametric anchors}

Integer parametric anchors make it easy to place an object at a repeatable
fraction of an edge without coordinate arithmetic:

\begin{lstlisting}[style=physicslatex]
\node[physicsblock, anchor=south] at (W.slope-50) {$m$};
\draw[->] (L.front-25) -- ++(-1,0);
\end{lstlisting}

For a family \key{name-0..100}, 0 is the documented start of the edge or arc,
50 is its midpoint, and 100 is its endpoint.

\subsection{Debug overlays}

The core library can label registered anchors and display the keys accepted by
a shape:

\begin{lstlisting}[style=physicslatex]
\begin{tikzpicture}[physics debug/anchors=true]
  \node[physicswedge, physics wedge width=4, physics wedge angle=30] (W) {};
\end{tikzpicture}
\end{lstlisting}

Use \key{physics debug/anchors=true}, \key{physics debug/keys=true}, or
\key{physics debug/all=true}. These options are intended for diagram development;
remove them from final artwork.

% -----------------------------------------------------------------------------
\section{Installation and development}

The package requires LaTeX2e and PGF/TikZ. It does not require shell escape,
external executables, special fonts, or a platform-specific runtime.

For manual installation, place \texttt{tikzphysics.sty} and every
\texttt{tikzlibrarytikzphysics*.code.tex} file in a directory searched by TeX.

The source distribution uses \texttt{l3build}:

\begin{lstlisting}[style=physicslatex,language=bash]
l3build check   # run coordinate and anchor regression tests
l3build doc     # build tikzphysics.pdf
l3build ctan    # create the CTAN and TDS archives
\end{lstlisting}

Standalone examples are stored in \texttt{examples/}. The command-line helper
\texttt{tikzphysics-help} prints a compact key and anchor reference.

% -----------------------------------------------------------------------------
\section{License}

Copyright \textcopyright\ 2026 Vaibhav Blayer.

This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License, either version 1.3c or (at your option) any later
version. This work has LPPL maintenance status ``maintained''. The Current
Maintainer is Vaibhav Blayer.

\end{document}
