%% tikzlibrarytikzphysics.elements.code.tex
%% -----------------------------------------------------------
%% Differential area elements for mechanics and calculus diagrams.
%%
%% Public nodes:
%%   polar element, differential sector, differential ring, unwrapped ring,
%%   spherical shell, hollow sphere, rectangular element, rectangular strip,
%%   rectangular sheet
%% Public pic:
%%   differential ring diagram, sphere shell diagram, sphere slice diagram,
%%   hollow sphere diagram, cylinder shell diagram, cylinder slice diagram,
%%   cone slice diagram, sheet element diagram
%%
%% Author  : Vaibhav Blayer
%% Version : v1.5.0 (2026-09-26)
%% License : LPPL 1.3c
%% -----------------------------------------------------------

\usetikzlibrary{patterns,calc,arrows.meta}
\usetikzlibrary{tikzphysics.core}

\makeatletter

\tikzphysics@declarehook{polar element}
\tikzphysics@declarehook{differential sector}
\tikzphysics@declarehook{differential ring}
\tikzphysics@declarehook{unwrapped ring}
\tikzphysics@declarehook{spherical shell}
\tikzphysics@declarehook{hollow sphere}
\tikzphysics@declarehook{rectangular element}
\tikzphysics@declarehook{rectangular strip}
\tikzphysics@declarehook{rectangular sheet}
\tikzphysics@declarehook{element dimension}
\tikzphysics@declarehook{element label}
\tikzphysics@declarehook{element body}
\tikzphysics@declarehook{element center}
\tikzphysics@declarehook{differential ring diagram}
\tikzphysics@declarehook{sphere shell diagram}
\tikzphysics@declarehook{sphere slice diagram}
\tikzphysics@declarehook{hollow sphere diagram}
\tikzphysics@declarehook{cylinder shell diagram}
\tikzphysics@declarehook{cylinder slice diagram}
\tikzphysics@declarehook{cone slice diagram}
\tikzphysics@declarehook{sheet element diagram}

%% ============================================================
%%  STATE AND VALIDATED GEOMETRY
%% ============================================================

\def\tikzphysics@elements@innervalue{1.8cm}
\def\tikzphysics@elements@outervalue{2cm}
\def\tikzphysics@elements@thicknessvalue{0.2cm}
\def\tikzphysics@elements@thicknessflag{0}
\def\tikzphysics@elements@startvalue{30}
\def\tikzphysics@elements@deltavalue{30}
\def\tikzphysics@elements@dimensionoffsetvalue{4mm}
\def\tikzphysics@elements@diagramgapvalue{5mm}
\def\tikzphysics@elements@bodyradiusvalue{2cm}
\def\tikzphysics@elements@centerdotradiusvalue{1.2pt}
\def\tikzphysics@elements@radiuslabel{$r$}
\def\tikzphysics@elements@radiallabel{$d\!r$}
\def\tikzphysics@elements@angularlabel{$d\!\theta$}
\def\tikzphysics@elements@arclabel{$r\,d\!\theta$}
\def\tikzphysics@elements@circumferencelabel{$2\pi r$}
\def\tikzphysics@elements@widthvalue{8mm}
\def\tikzphysics@elements@heightvalue{6mm}
\def\tikzphysics@elements@bodywidthvalue{5cm}
\def\tikzphysics@elements@bodyheightvalue{3cm}
\def\tikzphysics@elements@axialthicknessvalue{2mm}
\def\tikzphysics@elements@positionvalue{0.55}
\def\tikzphysics@elements@transversepositionvalue{0.58}
\def\tikzphysics@elements@projectionratiovalue{0.28}
\def\tikzphysics@elements@widthlabel{$d\!x$}
\def\tikzphysics@elements@heightlabel{$d\!y$}
\def\tikzphysics@elements@axiallabel{$d\!x$}
\def\tikzphysics@elements@bodyradiuslabel{$R$}
\def\tikzphysics@elements@cavityradiuslabel{$a$}
\def\tikzphysics@elements@formulalabel{}

\newdimen\tikzphysics@elements@inner
\newdimen\tikzphysics@elements@outer
\newdimen\tikzphysics@elements@thickness
\newdimen\tikzphysics@elements@mean
\newdimen\tikzphysics@elements@centroidradius
\newdimen\tikzphysics@elements@centroidx
\newdimen\tikzphysics@elements@centroidy
\newdimen\tikzphysics@elements@stripwidth
\newdimen\tikzphysics@elements@striphalfwidth
\newdimen\tikzphysics@elements@striphalfheight
\newdimen\tikzphysics@elements@dimensionoffset
\newdimen\tikzphysics@elements@diagramgap
\newdimen\tikzphysics@elements@bodyradius
\newdimen\tikzphysics@elements@centerdotradius
\newdimen\tikzphysics@elements@rectwidth
\newdimen\tikzphysics@elements@rectheight
\newdimen\tikzphysics@elements@recthalfwidth
\newdimen\tikzphysics@elements@recthalfheight
\newdimen\tikzphysics@elements@bodywidth
\newdimen\tikzphysics@elements@bodyheight
\newdimen\tikzphysics@elements@axialthickness

\def\tikzphysics@elements@start{30}
\def\tikzphysics@elements@delta{30}
\def\tikzphysics@elements@end{60}
\def\tikzphysics@elements@mid{45}

\newcommand{\tikzphysics@elements@setpolardims}{%
  \tikzphysics@resolve@nonnegative{\tikzphysics@elements@inner}%
    {\tikzphysics@elements@innervalue}%
  \ifnum\tikzphysics@elements@thicknessflag=1\relax
    \tikzphysics@resolve@length{\tikzphysics@elements@thickness}%
      {\tikzphysics@elements@thicknessvalue}%
    \tikzphysics@elements@outer=\tikzphysics@elements@inner
    \advance\tikzphysics@elements@outer by \tikzphysics@elements@thickness
  \else
    \tikzphysics@resolve@length{\tikzphysics@elements@outer}%
      {\tikzphysics@elements@outervalue}%
    \tikzphysics@elements@thickness=\tikzphysics@elements@outer
    \advance\tikzphysics@elements@thickness by -\tikzphysics@elements@inner
  \fi
  \ifdim\tikzphysics@elements@outer>\tikzphysics@elements@inner\relax\else
    \PackageError{tikzphysics}{element outer radius must exceed inner radius}%
      {Increase element outer radius or reduce element inner radius.}%
  \fi
  \tikzphysics@elements@mean=\tikzphysics@elements@inner
  \advance\tikzphysics@elements@mean by \tikzphysics@elements@outer
  \divide\tikzphysics@elements@mean by 2
  \pgfmathparse{\tikzphysics@elements@startvalue}%
  \ifpgfmathunitsdeclared
    \PackageError{tikzphysics}{element start angle must be unitless}%
      {Give the angle in degrees without a TeX dimension.}%
  \fi
  \edef\tikzphysics@elements@start{\pgfmathresult}%
  \pgfmathparse{\tikzphysics@elements@deltavalue}%
  \ifpgfmathunitsdeclared
    \PackageError{tikzphysics}{element delta angle must be unitless}%
      {Give the angular width in degrees without a TeX dimension.}%
  \fi
  \edef\tikzphysics@elements@delta{\pgfmathresult}%
  \ifdim\tikzphysics@elements@delta pt>0pt\relax\else
    \PackageError{tikzphysics}{element delta angle must be greater than zero}%
      {Use an angle in the interval (0,360].}%
  \fi
  \ifdim\tikzphysics@elements@delta pt>360pt\relax
    \PackageError{tikzphysics}{element delta angle must not exceed 360 degrees}%
      {Use an angle in the interval (0,360].}%
  \fi
  \pgfmathsetmacro{\tikzphysics@elements@end}%
    {\tikzphysics@elements@start+\tikzphysics@elements@delta}%
  \pgfmathsetmacro{\tikzphysics@elements@mid}%
    {\tikzphysics@elements@start+0.5*\tikzphysics@elements@delta}%
  %% Area centroid of an annular sector, measured along its angle bisector.
  %% The factored radius ratio avoids cubing TeX dimensions in PGF math.
  \ifdim\tikzphysics@elements@delta pt=360pt\relax
    \tikzphysics@elements@centroidradius=0pt
  \else
    \pgfmathsetmacro{\tikzphysics@elements@innerpt}%
      {\tikzphysics@elements@inner/1pt}%
    \pgfmathsetmacro{\tikzphysics@elements@outerpt}%
      {\tikzphysics@elements@outer/1pt}%
    \pgfmathsetmacro{\tikzphysics@elements@centroidpt}{%
      (4*sin(0.5*\tikzphysics@elements@delta)/
       (3*(\tikzphysics@elements@delta*pi/180)))*
      ((\tikzphysics@elements@outerpt^2+
        \tikzphysics@elements@outerpt*\tikzphysics@elements@innerpt+
        \tikzphysics@elements@innerpt^2)/
       (\tikzphysics@elements@outerpt+\tikzphysics@elements@innerpt))}%
    \pgfmathsetlength{\tikzphysics@elements@centroidradius}%
      {\tikzphysics@elements@centroidpt pt}%
  \fi
  \pgfmathsetlength{\tikzphysics@elements@centroidx}%
    {\tikzphysics@elements@centroidradius*cos(\tikzphysics@elements@mid)}%
  \pgfmathsetlength{\tikzphysics@elements@centroidy}%
    {\tikzphysics@elements@centroidradius*sin(\tikzphysics@elements@mid)}%
}

\newcommand{\tikzphysics@elements@setstripdims}{%
  \tikzphysics@elements@setpolardims
  \ifdim\tikzphysics@elements@inner>0pt\relax\else
    \PackageError{tikzphysics}{unwrapped ring requires a positive inner radius}%
      {Use a positive reference radius before unwrapping the ring.}%
  \fi
  \pgfmathsetlength{\tikzphysics@elements@stripwidth}%
    {2*pi*\tikzphysics@elements@inner}%
  \tikzphysics@elements@striphalfwidth=.5\tikzphysics@elements@stripwidth
  \tikzphysics@elements@striphalfheight=.5\tikzphysics@elements@thickness
}

%% ============================================================
%%  PARAMETRIC ARC AND RADIAL ANCHORS
%% ============================================================

\def\tikzphysics@elements@declarearcanchor@one#1#2#3#4#5{%
  \anchor{#1-#2}{%
    \pgfmathsetmacro{\tikzphysics@elements@@angle}%
      {(#4)+((#2)/100)*((#5)-(#4))}%
    \pgfmathsetlength{\pgf@x}{(#3)*cos(\tikzphysics@elements@@angle)}%
    \pgfmathsetlength{\pgf@y}{(#3)*sin(\tikzphysics@elements@@angle)}%
  }%
}
\def\tikzphysics@elements@declarearcanchors#1#2#3#4{%
  \foreach \tikzphysics@elements@@t in {0,1,...,100}{%
    \edef\tikzphysics@elements@@partial{%
      \noexpand\tikzphysics@elements@declarearcanchor@one
        {#1}{\tikzphysics@elements@@t}}%
    \tikzphysics@elements@@partial{#2}{#3}{#4}%
  }%
}
\def\tikzphysics@elements@declareedgeanchor@one#1#2#3#4#5#6{%
  \anchor{#1-#2}{%
    \pgfmathsetlength{\pgf@x}{(#3)+((#2)/100)*((#5)-(#3))}%
    \pgfmathsetlength{\pgf@y}{(#4)+((#2)/100)*((#6)-(#4))}%
  }%
}
\def\tikzphysics@elements@declareedgeanchors#1#2#3#4#5{%
  \foreach \tikzphysics@elements@@t in {0,1,...,100}{%
    \edef\tikzphysics@elements@@partial{%
      \noexpand\tikzphysics@elements@declareedgeanchor@one
        {#1}{\tikzphysics@elements@@t}}%
    \tikzphysics@elements@@partial{#2}{#3}{#4}{#5}%
  }%
}

%% ============================================================
%%  POLAR ELEMENT SHAPE
%% ============================================================

\pgfdeclareshape{physicspolarelement}{
  \savedmacro\tikzphysics@elements@savedfont{%
    \def\tikzphysics@elements@savedfont{\unexpanded\expandafter{\tikz@textfont}}}%
%
  \savedmacro\tikzphysics@elements@savedradiuslabel{%
    \def\tikzphysics@elements@savedradiuslabel{\unexpanded\expandafter{\tikzphysics@elements@radiuslabel}}}%
  \savedmacro\tikzphysics@elements@savedradiallabel{%
    \def\tikzphysics@elements@savedradiallabel{\unexpanded\expandafter{\tikzphysics@elements@radiallabel}}}%
  \savedmacro\tikzphysics@elements@savedangularlabel{%
    \def\tikzphysics@elements@savedangularlabel{\unexpanded\expandafter{\tikzphysics@elements@angularlabel}}}%
  \savedmacro\tikzphysics@elements@savedarclabel{%
    \def\tikzphysics@elements@savedarclabel{\unexpanded\expandafter{\tikzphysics@elements@arclabel}}}%
  \savedmacro{\tikzphysics@elements@p@inner}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@inner{\the\tikzphysics@elements@inner}%
  }
  \savedmacro{\tikzphysics@elements@p@outer}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@outer{\the\tikzphysics@elements@outer}%
  }
  \savedmacro{\tikzphysics@elements@p@thickness}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@thickness{\the\tikzphysics@elements@thickness}%
  }
  \savedmacro{\tikzphysics@elements@p@start}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@start{\tikzphysics@elements@start}%
  }
  \savedmacro{\tikzphysics@elements@p@delta}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@delta{\tikzphysics@elements@delta}%
  }
  \savedmacro{\tikzphysics@elements@p@end}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@end{\tikzphysics@elements@end}%
  }
  \savedmacro{\tikzphysics@elements@p@mid}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@mid{\tikzphysics@elements@mid}%
  }
  \savedmacro{\tikzphysics@elements@p@cx}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@cx{\the\tikzphysics@elements@centroidx}%
  }
  \savedmacro{\tikzphysics@elements@p@cy}{%
    \tikzphysics@elements@setpolardims
    \edef\tikzphysics@elements@p@cy{\the\tikzphysics@elements@centroidy}%
  }

  %% Full-circle bounding anchors keep placement predictable for sectors too.
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpointorigin}
  \anchor{north}{\pgf@x=0pt \pgf@y=\tikzphysics@elements@p@outer}
  \anchor{south}{\pgf@x=0pt \pgf@y=-\tikzphysics@elements@p@outer}
  \anchor{east}{\pgf@x=\tikzphysics@elements@p@outer \pgf@y=0pt}
  \anchor{west}{\pgf@x=-\tikzphysics@elements@p@outer \pgf@y=0pt}
  \anchor{north east}{\pgf@x=\tikzphysics@elements@p@outer \pgf@y=\tikzphysics@elements@p@outer}
  \anchor{north west}{\pgf@x=-\tikzphysics@elements@p@outer \pgf@y=\tikzphysics@elements@p@outer}
  \anchor{south east}{\pgf@x=\tikzphysics@elements@p@outer \pgf@y=-\tikzphysics@elements@p@outer}
  \anchor{south west}{\pgf@x=-\tikzphysics@elements@p@outer \pgf@y=-\tikzphysics@elements@p@outer}
  \anchor{centroid}{\pgf@x=\tikzphysics@elements@p@cx \pgf@y=\tikzphysics@elements@p@cy}

  \anchor{inner-start}{%
    \pgfmathsetlength{\pgf@x}{\tikzphysics@elements@p@inner*cos(\tikzphysics@elements@p@start)}%
    \pgfmathsetlength{\pgf@y}{\tikzphysics@elements@p@inner*sin(\tikzphysics@elements@p@start)}%
  }
  \anchor{inner-mid}{%
    \pgfmathsetlength{\pgf@x}{\tikzphysics@elements@p@inner*cos(\tikzphysics@elements@p@mid)}%
    \pgfmathsetlength{\pgf@y}{\tikzphysics@elements@p@inner*sin(\tikzphysics@elements@p@mid)}%
  }
  \anchor{inner-end}{%
    \pgfmathsetlength{\pgf@x}{\tikzphysics@elements@p@inner*cos(\tikzphysics@elements@p@end)}%
    \pgfmathsetlength{\pgf@y}{\tikzphysics@elements@p@inner*sin(\tikzphysics@elements@p@end)}%
  }
  \anchor{outer-start}{%
    \pgfmathsetlength{\pgf@x}{\tikzphysics@elements@p@outer*cos(\tikzphysics@elements@p@start)}%
    \pgfmathsetlength{\pgf@y}{\tikzphysics@elements@p@outer*sin(\tikzphysics@elements@p@start)}%
  }
  \anchor{outer-mid}{%
    \pgfmathsetlength{\pgf@x}{\tikzphysics@elements@p@outer*cos(\tikzphysics@elements@p@mid)}%
    \pgfmathsetlength{\pgf@y}{\tikzphysics@elements@p@outer*sin(\tikzphysics@elements@p@mid)}%
  }
  \anchor{outer-end}{%
    \pgfmathsetlength{\pgf@x}{\tikzphysics@elements@p@outer*cos(\tikzphysics@elements@p@end)}%
    \pgfmathsetlength{\pgf@y}{\tikzphysics@elements@p@outer*sin(\tikzphysics@elements@p@end)}%
  }
  \anchor{start-mid}{%
    \pgfmathsetlength{\pgf@x}{0.5*(\tikzphysics@elements@p@inner+\tikzphysics@elements@p@outer)*cos(\tikzphysics@elements@p@start)}%
    \pgfmathsetlength{\pgf@y}{0.5*(\tikzphysics@elements@p@inner+\tikzphysics@elements@p@outer)*sin(\tikzphysics@elements@p@start)}%
  }
  \anchor{end-mid}{%
    \pgfmathsetlength{\pgf@x}{0.5*(\tikzphysics@elements@p@inner+\tikzphysics@elements@p@outer)*cos(\tikzphysics@elements@p@end)}%
    \pgfmathsetlength{\pgf@y}{0.5*(\tikzphysics@elements@p@inner+\tikzphysics@elements@p@outer)*sin(\tikzphysics@elements@p@end)}%
  }

  \tikzphysics@elements@declarearcanchors{inner}
    {\tikzphysics@elements@p@inner}{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@end}
  \tikzphysics@elements@declarearcanchors{outer}
    {\tikzphysics@elements@p@outer}{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@end}
  \tikzphysics@elements@declareedgeanchors{start}
    {\tikzphysics@elements@p@inner*cos(\tikzphysics@elements@p@start)}
    {\tikzphysics@elements@p@inner*sin(\tikzphysics@elements@p@start)}
    {\tikzphysics@elements@p@outer*cos(\tikzphysics@elements@p@start)}
    {\tikzphysics@elements@p@outer*sin(\tikzphysics@elements@p@start)}
  \tikzphysics@elements@declareedgeanchors{end}
    {\tikzphysics@elements@p@inner*cos(\tikzphysics@elements@p@end)}
    {\tikzphysics@elements@p@inner*sin(\tikzphysics@elements@p@end)}
    {\tikzphysics@elements@p@outer*cos(\tikzphysics@elements@p@end)}
    {\tikzphysics@elements@p@outer*sin(\tikzphysics@elements@p@end)}

  \anchorborder{%
    \@tempdima=\pgf@x \@tempdimb=\pgf@y
    \pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}%
      {\pgfqpoint{\tikzphysics@elements@p@outer}{\tikzphysics@elements@p@outer}}%
  }

  \backgroundpath{%
    \ifdim\tikzphysics@elements@p@delta pt=360pt\relax
      %% Separate, oppositely wound closed circles avoid a visible radial seam.
      \pgfpathmoveto{\pgfpointpolar{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@outer}}%
      \pgfpatharc{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@outer}%
      \pgfpathclose
      \ifdim\tikzphysics@elements@p@inner=0pt\relax\else
        \pgfpathmoveto{\pgfpointpolar{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@inner}}%
        \pgfpatharc{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@inner}%
        \pgfpathclose
      \fi
    \else\ifdim\tikzphysics@elements@p@inner=0pt\relax
      \pgfpathmoveto{\pgfpointorigin}%
      \pgfpathlineto{\pgfpointpolar{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@outer}}%
      \pgfpatharc{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@outer}%
      \pgfpathclose
    \else
      \pgfpathmoveto{\pgfpointpolar{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@inner}}%
      \pgfpathlineto{\pgfpointpolar{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@outer}}%
      \pgfpatharc{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@outer}%
      \pgfpathlineto{\pgfpointpolar{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@inner}}%
      \pgfpatharc{\tikzphysics@elements@p@end}{\tikzphysics@elements@p@start}{\tikzphysics@elements@p@inner}%
      \pgfpathclose
    \fi
    \fi
  }
}

%% ============================================================
%%  UNWRAPPED RING SHAPE
%% ============================================================

\pgfdeclareshape{physicsunwrappedring}{
  \savedmacro\tikzphysics@elements@savedfont{%
    \def\tikzphysics@elements@savedfont{\unexpanded\expandafter{\tikz@textfont}}}%
%
  \savedmacro\tikzphysics@elements@savedradiallabel{%
    \def\tikzphysics@elements@savedradiallabel{\unexpanded\expandafter{\tikzphysics@elements@radiallabel}}}%
  \savedmacro\tikzphysics@elements@savedcircumferencelabel{%
    \def\tikzphysics@elements@savedcircumferencelabel{\unexpanded\expandafter{\tikzphysics@elements@circumferencelabel}}}%
  \savedmacro{\tikzphysics@elements@u@inner}{%
    \tikzphysics@elements@setstripdims
    \edef\tikzphysics@elements@u@inner{\the\tikzphysics@elements@inner}%
  }
  \savedmacro{\tikzphysics@elements@u@outer}{%
    \tikzphysics@elements@setstripdims
    \edef\tikzphysics@elements@u@outer{\the\tikzphysics@elements@outer}%
  }
  \savedmacro{\tikzphysics@elements@u@mean}{%
    \tikzphysics@elements@setstripdims
    \edef\tikzphysics@elements@u@mean{\the\tikzphysics@elements@mean}%
  }
  \savedmacro{\tikzphysics@elements@u@thickness}{%
    \tikzphysics@elements@setstripdims
    \edef\tikzphysics@elements@u@thickness{\the\tikzphysics@elements@thickness}%
  }
  \savedmacro{\tikzphysics@elements@u@hx}{%
    \tikzphysics@elements@setstripdims
    \edef\tikzphysics@elements@u@hx{\the\tikzphysics@elements@striphalfwidth}%
  }
  \savedmacro{\tikzphysics@elements@u@hy}{%
    \tikzphysics@elements@setstripdims
    \edef\tikzphysics@elements@u@hy{\the\tikzphysics@elements@striphalfheight}%
  }

  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpointorigin}
  \anchor{centroid}{\pgfpointorigin}
  \anchor{north}{\pgf@x=0pt \pgf@y=\tikzphysics@elements@u@hy}
  \anchor{south}{\pgf@x=0pt \pgf@y=-\tikzphysics@elements@u@hy}
  \anchor{east}{\pgf@x=\tikzphysics@elements@u@hx \pgf@y=0pt}
  \anchor{west}{\pgf@x=-\tikzphysics@elements@u@hx \pgf@y=0pt}
  \anchor{north east}{\pgf@x=\tikzphysics@elements@u@hx \pgf@y=\tikzphysics@elements@u@hy}
  \anchor{north west}{\pgf@x=-\tikzphysics@elements@u@hx \pgf@y=\tikzphysics@elements@u@hy}
  \anchor{south east}{\pgf@x=\tikzphysics@elements@u@hx \pgf@y=-\tikzphysics@elements@u@hy}
  \anchor{south west}{\pgf@x=-\tikzphysics@elements@u@hx \pgf@y=-\tikzphysics@elements@u@hy}
  \anchor{top-left}{\pgf@x=-\tikzphysics@elements@u@hx \pgf@y=\tikzphysics@elements@u@hy}
  \anchor{top-right}{\pgf@x=\tikzphysics@elements@u@hx \pgf@y=\tikzphysics@elements@u@hy}
  \anchor{bottom-left}{\pgf@x=-\tikzphysics@elements@u@hx \pgf@y=-\tikzphysics@elements@u@hy}
  \anchor{bottom-right}{\pgf@x=\tikzphysics@elements@u@hx \pgf@y=-\tikzphysics@elements@u@hy}
  \tikzphysics@declareedgeanchors{bottom}
    {-\tikzphysics@elements@u@hx}{-\tikzphysics@elements@u@hy}
    {\tikzphysics@elements@u@hx}{-\tikzphysics@elements@u@hy}
  \tikzphysics@declareedgeanchors{right}
    {\tikzphysics@elements@u@hx}{-\tikzphysics@elements@u@hy}
    {\tikzphysics@elements@u@hx}{\tikzphysics@elements@u@hy}
  \tikzphysics@declareedgeanchors{top}
    {\tikzphysics@elements@u@hx}{\tikzphysics@elements@u@hy}
    {-\tikzphysics@elements@u@hx}{\tikzphysics@elements@u@hy}
  \tikzphysics@declareedgeanchors{left}
    {-\tikzphysics@elements@u@hx}{\tikzphysics@elements@u@hy}
    {-\tikzphysics@elements@u@hx}{-\tikzphysics@elements@u@hy}
  \anchorborder{%
    \@tempdima=\pgf@x \@tempdimb=\pgf@y
    \pgfpointborderrectangle{\pgfqpoint{\@tempdima}{\@tempdimb}}%
      {\pgfqpoint{\tikzphysics@elements@u@hx}{\tikzphysics@elements@u@hy}}%
  }
  \backgroundpath{%
    \pgfpathrectanglecorners
      {\pgfpoint{-\tikzphysics@elements@u@hx}{-\tikzphysics@elements@u@hy}}%
      {\pgfpoint{\tikzphysics@elements@u@hx}{\tikzphysics@elements@u@hy}}%
  }
}

%% ============================================================
%%  RECTANGULAR DIFFERENTIAL ELEMENT SHAPE
%% ============================================================

\newcommand{\tikzphysics@elements@setrectdims}{%
  \tikzphysics@resolve@length{\tikzphysics@elements@rectwidth}%
    {\tikzphysics@elements@widthvalue}%
  \tikzphysics@resolve@length{\tikzphysics@elements@rectheight}%
    {\tikzphysics@elements@heightvalue}%
  \tikzphysics@elements@recthalfwidth=.5\tikzphysics@elements@rectwidth
  \tikzphysics@elements@recthalfheight=.5\tikzphysics@elements@rectheight
}

\pgfdeclareshape{physicsrectangularelement}{
  \savedmacro\tikzphysics@elements@savedfont{%
    \def\tikzphysics@elements@savedfont{\unexpanded\expandafter{\tikz@textfont}}}%
%
  \savedmacro\tikzphysics@elements@savedwidthlabel{%
    \def\tikzphysics@elements@savedwidthlabel{\unexpanded\expandafter{\tikzphysics@elements@widthlabel}}}%
  \savedmacro\tikzphysics@elements@savedheightlabel{%
    \def\tikzphysics@elements@savedheightlabel{\unexpanded\expandafter{\tikzphysics@elements@heightlabel}}}%
  \savedmacro{\tikzphysics@elements@re@width}{%
    \tikzphysics@elements@setrectdims
    \edef\tikzphysics@elements@re@width{\the\tikzphysics@elements@rectwidth}%
  }
  \savedmacro{\tikzphysics@elements@re@height}{%
    \tikzphysics@elements@setrectdims
    \edef\tikzphysics@elements@re@height{\the\tikzphysics@elements@rectheight}%
  }
  \savedmacro{\tikzphysics@elements@re@hx}{%
    \tikzphysics@elements@setrectdims
    \edef\tikzphysics@elements@re@hx{\the\tikzphysics@elements@recthalfwidth}%
  }
  \savedmacro{\tikzphysics@elements@re@hy}{%
    \tikzphysics@elements@setrectdims
    \edef\tikzphysics@elements@re@hy{\the\tikzphysics@elements@recthalfheight}%
  }
  \anchor{center}{\pgfpointorigin}
  \anchor{text}{\pgfpointorigin}
  \anchor{centroid}{\pgfpointorigin}
  \anchor{north}{\pgf@x=0pt \pgf@y=\tikzphysics@elements@re@hy}
  \anchor{south}{\pgf@x=0pt \pgf@y=-\tikzphysics@elements@re@hy}
  \anchor{east}{\pgf@x=\tikzphysics@elements@re@hx \pgf@y=0pt}
  \anchor{west}{\pgf@x=-\tikzphysics@elements@re@hx \pgf@y=0pt}
  \anchor{north east}{\pgf@x=\tikzphysics@elements@re@hx \pgf@y=\tikzphysics@elements@re@hy}
  \anchor{north west}{\pgf@x=-\tikzphysics@elements@re@hx \pgf@y=\tikzphysics@elements@re@hy}
  \anchor{south east}{\pgf@x=\tikzphysics@elements@re@hx \pgf@y=-\tikzphysics@elements@re@hy}
  \anchor{south west}{\pgf@x=-\tikzphysics@elements@re@hx \pgf@y=-\tikzphysics@elements@re@hy}
  \anchor{top-left}{\pgf@x=-\tikzphysics@elements@re@hx \pgf@y=\tikzphysics@elements@re@hy}
  \anchor{top-right}{\pgf@x=\tikzphysics@elements@re@hx \pgf@y=\tikzphysics@elements@re@hy}
  \anchor{bottom-left}{\pgf@x=-\tikzphysics@elements@re@hx \pgf@y=-\tikzphysics@elements@re@hy}
  \anchor{bottom-right}{\pgf@x=\tikzphysics@elements@re@hx \pgf@y=-\tikzphysics@elements@re@hy}
  \tikzphysics@declareedgeanchors{bottom}
    {-\tikzphysics@elements@re@hx}{-\tikzphysics@elements@re@hy}
    {\tikzphysics@elements@re@hx}{-\tikzphysics@elements@re@hy}
  \tikzphysics@declareedgeanchors{right}
    {\tikzphysics@elements@re@hx}{-\tikzphysics@elements@re@hy}
    {\tikzphysics@elements@re@hx}{\tikzphysics@elements@re@hy}
  \tikzphysics@declareedgeanchors{top}
    {\tikzphysics@elements@re@hx}{\tikzphysics@elements@re@hy}
    {-\tikzphysics@elements@re@hx}{\tikzphysics@elements@re@hy}
  \tikzphysics@declareedgeanchors{left}
    {-\tikzphysics@elements@re@hx}{\tikzphysics@elements@re@hy}
    {-\tikzphysics@elements@re@hx}{-\tikzphysics@elements@re@hy}
  \anchorborder{%
    \@tempdima=\pgf@x \@tempdimb=\pgf@y
    \pgfpointborderrectangle{\pgfqpoint{\@tempdima}{\@tempdimb}}%
      {\pgfqpoint{\tikzphysics@elements@re@hx}{\tikzphysics@elements@re@hy}}%
  }
  \backgroundpath{%
    \pgfpathrectanglecorners
      {\pgfpoint{-\tikzphysics@elements@re@hx}{-\tikzphysics@elements@re@hy}}%
      {\pgfpoint{\tikzphysics@elements@re@hx}{\tikzphysics@elements@re@hy}}%
  }
}

%% ============================================================
%%  PER-NODE GEOMETRY VALUES
%% ============================================================

\newcommand{\tikzphysics@elements@recordpolar}[1]{%
  \begingroup
    \csname pgf@sh@ma@#1\endcsname
    \tikzphysics@storegeometryvalue{#1}{inner radius}{\tikzphysics@elements@p@inner}%
    \tikzphysics@storegeometryvalue{#1}{outer radius}{\tikzphysics@elements@p@outer}%
    \tikzphysics@storegeometryvalue{#1}{radial thickness}{\tikzphysics@elements@p@thickness}%
    \tikzphysics@storegeometryvalue{#1}{start angle}{\tikzphysics@elements@p@start}%
    \tikzphysics@storegeometryvalue{#1}{delta angle}{\tikzphysics@elements@p@delta}%
    \tikzphysics@storegeometryvalue{#1}{end angle}{\tikzphysics@elements@p@end}%
    \pgfmathsetlength{\@tempdima}{0.5*(\tikzphysics@elements@p@inner+\tikzphysics@elements@p@outer)}%
    \tikzphysics@storegeometryvalue{#1}{mean radius}{\the\@tempdima}%
  \endgroup
}
\newcommand{\tikzphysics@elements@recordunwrapped}[1]{%
  \begingroup
    \csname pgf@sh@ma@#1\endcsname
    \tikzphysics@storegeometryvalue{#1}{inner radius}{\tikzphysics@elements@u@inner}%
    \tikzphysics@storegeometryvalue{#1}{outer radius}{\tikzphysics@elements@u@outer}%
    \tikzphysics@storegeometryvalue{#1}{radial thickness}{\tikzphysics@elements@u@thickness}%
    \tikzphysics@storegeometryvalue{#1}{mean radius}{\tikzphysics@elements@u@mean}%
    \pgfmathsetlength{\@tempdima}{2*\tikzphysics@elements@u@hx}%
    \tikzphysics@storegeometryvalue{#1}{circumference}{\the\@tempdima}%
  \endgroup
}
\newcommand{\tikzphysics@elements@recordrectangle}[1]{%
  \begingroup
    \csname pgf@sh@ma@#1\endcsname
    \tikzphysics@storegeometryvalue{#1}{width}{\tikzphysics@elements@re@width}%
    \tikzphysics@storegeometryvalue{#1}{height}{\tikzphysics@elements@re@height}%
  \endgroup
}
\tikzphysics@registergeometryrecorder{physicspolarelement}{\tikzphysics@elements@recordpolar}
\tikzphysics@registergeometryrecorder{physicsunwrappedring}{\tikzphysics@elements@recordunwrapped}
\tikzphysics@registergeometryrecorder{physicsrectangularelement}{\tikzphysics@elements@recordrectangle}

%% ============================================================
%%  KEYS, STYLES, AND DIMENSION OVERLAYS
%% ============================================================

\tikzset{
  physics element inner radius/.code={\def\tikzphysics@elements@innervalue{#1}},
  physics element outer radius/.code={%
    \def\tikzphysics@elements@outervalue{#1}%
    \def\tikzphysics@elements@thicknessflag{0}},
  physics element radial thickness/.code={%
    \def\tikzphysics@elements@thicknessvalue{#1}%
    \def\tikzphysics@elements@thicknessflag{1}},
  physics element start angle/.code={\def\tikzphysics@elements@startvalue{#1}},
  physics element delta angle/.code={\def\tikzphysics@elements@deltavalue{#1}},
  physics element dimension offset/.code={\def\tikzphysics@elements@dimensionoffsetvalue{#1}},
  physics element diagram gap/.code={\def\tikzphysics@elements@diagramgapvalue{#1}},
  physics element body radius/.code={\def\tikzphysics@elements@bodyradiusvalue{#1}},
  physics element center dot radius/.code={\def\tikzphysics@elements@centerdotradiusvalue{#1}},
  physics element width/.code={\def\tikzphysics@elements@widthvalue{#1}},
  physics element height/.code={\def\tikzphysics@elements@heightvalue{#1}},
  physics element body width/.code={\def\tikzphysics@elements@bodywidthvalue{#1}},
  physics element body height/.code={\def\tikzphysics@elements@bodyheightvalue{#1}},
  physics element axial thickness/.code={\def\tikzphysics@elements@axialthicknessvalue{#1}},
  physics element position/.code={\def\tikzphysics@elements@positionvalue{#1}},
  physics element transverse position/.code={\def\tikzphysics@elements@transversepositionvalue{#1}},
  physics element projection ratio/.code={\def\tikzphysics@elements@projectionratiovalue{#1}},
  physics element radius label/.code={\def\tikzphysics@elements@radiuslabel{#1}},
  physics element radial label/.code={\def\tikzphysics@elements@radiallabel{#1}},
  physics element angular label/.code={\def\tikzphysics@elements@angularlabel{#1}},
  physics element arc label/.code={\def\tikzphysics@elements@arclabel{#1}},
  physics element circumference label/.code={\def\tikzphysics@elements@circumferencelabel{#1}},
  physics element width label/.code={\def\tikzphysics@elements@widthlabel{#1}},
  physics element height label/.code={\def\tikzphysics@elements@heightlabel{#1}},
  physics element axial label/.code={\def\tikzphysics@elements@axiallabel{#1}},
  physics element body radius label/.code={\def\tikzphysics@elements@bodyradiuslabel{#1}},
  physics element cavity radius label/.code={\def\tikzphysics@elements@cavityradiuslabel{#1}},
  physics element formula label/.code={\def\tikzphysics@elements@formulalabel{#1}},
  physics element source/.code={%
    \ifcsname tikzphysics@geometry@value@#1@inner radius\endcsname
      \edef\tikzphysics@elements@innervalue{%
        \csname tikzphysics@geometry@value@#1@inner radius\endcsname}%
      \edef\tikzphysics@elements@outervalue{%
        \csname tikzphysics@geometry@value@#1@outer radius\endcsname}%
      \def\tikzphysics@elements@thicknessflag{0}%
    \else
      \PackageError{tikzphysics}{element source `#1' has no radial geometry}%
        {Name a polar element or differential ring before using it as a source.}%
    \fi},
  element inner radius/.style={physics element inner radius={#1}},
  element outer radius/.style={physics element outer radius={#1}},
  element radial thickness/.style={physics element radial thickness={#1}},
  element start angle/.style={physics element start angle={#1}},
  element delta angle/.style={physics element delta angle={#1}},
  element dimension offset/.style={physics element dimension offset={#1}},
  element diagram gap/.style={physics element diagram gap={#1}},
  element body radius/.style={physics element body radius={#1}},
  element center dot radius/.style={physics element center dot radius={#1}},
  element width/.style={physics element width={#1}},
  element height/.style={physics element height={#1}},
  element body width/.style={physics element body width={#1}},
  element body height/.style={physics element body height={#1}},
  element axial thickness/.style={physics element axial thickness={#1}},
  element position/.style={physics element position={#1}},
  element transverse position/.style={physics element transverse position={#1}},
  element projection ratio/.style={physics element projection ratio={#1}},
  element radius label/.style={physics element radius label={#1}},
  element radial label/.style={physics element radial label={#1}},
  element angular label/.style={physics element angular label={#1}},
  element arc label/.style={physics element arc label={#1}},
  element circumference label/.style={physics element circumference label={#1}},
  element width label/.style={physics element width label={#1}},
  element height label/.style={physics element height label={#1}},
  element axial label/.style={physics element axial label={#1}},
  element body radius label/.style={physics element body radius label={#1}},
  element cavity radius label/.style={physics element cavity radius label={#1}},
  element formula label/.style={physics element formula label={#1}},
  source element/.style={physics element source={#1}},
  physics element defaults/.style={
    physics element inner radius=1.8cm,
    physics element outer radius=2cm,
    physics element start angle=30,
    physics element delta angle=30,
    physics element dimension offset=4mm,
    physics element diagram gap=5mm,
    physics element body radius=2cm,
    physics element center dot radius=1.2pt,
    physics element width=8mm,
    physics element height=6mm,
    physics element body width=5cm,
    physics element body height=3cm,
    physics element axial thickness=2mm,
    physics element position=0.55,
    physics element transverse position=0.58,
    physics element projection ratio=0.28,
    physics element radius label={$r$},
    physics element radial label={$d\!r$},
    physics element angular label={$d\!\theta$},
    physics element arc label={$r\,d\!\theta$},
    physics element circumference label={$2\pi r$},
    physics element width label={$d\!x$},
    physics element height label={$d\!y$},
    physics element axial label={$d\!x$},
    physics element body radius label={$R$},
    physics element cavity radius label={$a$},
    physics element formula label={},
  },
  physics polar element base/.style={
    physics element defaults,
    shape=physicspolarelement,
    physics geometry shape=physicspolarelement,
    draw=black,fill=white,pattern=north east lines,pattern color=black,
    line width=.5pt,inner sep=0pt,outer sep=0pt,
    physics debug setup,every physics object,
  },
  physicspolarelement/.style={
    physics polar element base,
    physics logical shape=physicspolarelement,
    every polar element,
  },
  physicsdifferentialsector/.style={
    physics polar element base,
    physics element inner radius=0cm,
    physics logical shape=physicsdifferentialsector,
    every polar element,every differential sector,
  },
  physicsdifferentialring/.style={
    physics polar element base,
    physics element delta angle=360,
    physics logical shape=physicsdifferentialring,
    every polar element,every differential ring,
  },
  physicsunwrappedring/.style={
    physics element defaults,
    shape=physicsunwrappedring,
    physics geometry shape=physicsunwrappedring,
    physics logical shape=physicsunwrappedring,
    draw=black,fill=white,pattern=north east lines,pattern color=black,
    line width=.5pt,inner sep=0pt,outer sep=0pt,
    physics debug setup,every physics object,every unwrapped ring,
  },
  physicssphericalshell/.style={
    physics polar element base,
    physics element inner radius=1cm,
    physics element radial thickness=1.5mm,
    physics element delta angle=360,
    physics logical shape=physicssphericalshell,
    every polar element,every spherical shell,
  },
  physicshollowsphere/.style={
    physics polar element base,
    physics element inner radius=1cm,
    physics element outer radius=2cm,
    physics element delta angle=360,
    physics logical shape=physicshollowsphere,
    every polar element,every hollow sphere,
  },
  physics rectangular element base/.style={
    physics element defaults,
    shape=physicsrectangularelement,
    physics geometry shape=physicsrectangularelement,
    draw=black,fill=white,pattern=north east lines,pattern color=black,
    line width=.5pt,inner sep=0pt,outer sep=0pt,
    physics debug setup,every physics object,
  },
  physicsrectangularelement/.style={
    physics rectangular element base,
    physics logical shape=physicsrectangularelement,
    every rectangular element,
  },
  physicsrectangularstrip/.style={
    physics rectangular element base,
    physics element width=4cm,
    physics element height=2mm,
    physics element width label={$b$},
    physics element height label={$d\!x$},
    physics logical shape=physicsrectangularstrip,
    every rectangular element,every rectangular strip,
  },
  physicsrectangularsheet/.style={
    physics element defaults,
    shape=physicsrectangularelement,
    physics geometry shape=physicsrectangularelement,
    physics element width=5cm,
    physics element height=3cm,
    physics logical shape=physicsrectangularsheet,
    draw=black,fill=white,line width=.5pt,inner sep=0pt,outer sep=0pt,
    physics debug setup,every physics object,every rectangular sheet,
  },
  physics polar element/.style={physicspolarelement},
  physics differential sector/.style={physicsdifferentialsector},
  physics differential ring/.style={physicsdifferentialring},
  physics unwrapped ring/.style={physicsunwrappedring},
  physics spherical shell/.style={physicssphericalshell},
  physics hollow sphere/.style={physicshollowsphere},
  physics rectangular element/.style={physicsrectangularelement},
  physics rectangular strip/.style={physicsrectangularstrip},
  physics rectangular sheet/.style={physicsrectangularsheet},
  polar element/.style={physicspolarelement},
  differential sector/.style={physicsdifferentialsector},
  differential ring/.style={physicsdifferentialring},
  unwrapped ring/.style={physicsunwrappedring},
  spherical shell/.style={physicssphericalshell},
  hollow sphere/.style={physicshollowsphere},
  rectangular element/.style={physicsrectangularelement},
  rectangular strip/.style={physicsrectangularstrip},
  rectangular sheet/.style={physicsrectangularsheet},
  every physics element dimension/.style={/utils/exec={\tikz@textfont},draw=black,line width=.04em,>={Latex[length=.65em,width=.45em]}},
  every element dimension/.style={every physics element dimension},
  every physics element label/.style={inner sep=.12em,fill=white},
  every element label/.style={every physics element label},
  every physics element body/.style={draw=black,fill=none,line width=.5pt},
  every element body/.style={every physics element body},
  every physics element center/.style={fill=black,draw=none},
  every element center/.style={every physics element center},
  physics element show dimensions/.style={
    append after command={\pgfextra{%
      \edef\tikzphysics@elements@dimensionnode{\tikzlastnode}%
      \ifx\tikzphysics@elements@dimensionnode\@empty\else
        \expandafter\tikzphysics@elements@drawdimensions
          \expandafter{\tikzphysics@elements@dimensionnode}%
      \fi
    }}},
  show dimensions/.style={physics element show dimensions},
}

\def\tikzphysics@elements@drawpolyarc#1#2#3{%
  \draw[every element dimension]
    ($(#1.center)!#3!(#1.#2-0)$)--
    ($(#1.center)!#3!(#1.#2-10)$)--
    ($(#1.center)!#3!(#1.#2-20)$)--
    ($(#1.center)!#3!(#1.#2-30)$)--
    ($(#1.center)!#3!(#1.#2-40)$)--
    ($(#1.center)!#3!(#1.#2-50)$)--
    ($(#1.center)!#3!(#1.#2-60)$)--
    ($(#1.center)!#3!(#1.#2-70)$)--
    ($(#1.center)!#3!(#1.#2-80)$)--
    ($(#1.center)!#3!(#1.#2-90)$)--
    ($(#1.center)!#3!(#1.#2-100)$);%
}

\def\tikzphysics@elements@drawdimensions#1{%
  \begingroup
  \csname pgf@sh@ma@#1\endcsname
  \let\tikz@textfont\tikzphysics@elements@savedfont
  \tikz@textfont

  \edef\tikzphysics@elements@actualshape{\csname pgf@sh@ns@#1\endcsname}%
  \def\tikzphysics@elements@unwrappedshape{physicsunwrappedring}%
  \def\tikzphysics@elements@rectangleshape{physicsrectangularelement}%
  \ifx\tikzphysics@elements@actualshape\tikzphysics@elements@unwrappedshape
    \tikzphysics@elements@drawstripdimensions{#1}%
  \else\ifx\tikzphysics@elements@actualshape\tikzphysics@elements@rectangleshape
    \tikzphysics@elements@drawrectdimensions{#1}%
  \else
    \tikzphysics@elements@drawpolardimensions{#1}%
  \fi
  \fi
  \endgroup
}

\def\tikzphysics@elements@drawpolardimensions#1{%
  \begingroup
    \@tempdima=\geometryvalue{#1}{inner radius}\relax
    \@tempdimb=\geometryvalue{#1}{outer radius}\relax
    \tikzphysics@resolve@nonnegative{\tikzphysics@elements@dimensionoffset}%
      {\tikzphysics@elements@dimensionoffsetvalue}%
    \pgfmathsetmacro{\tikzphysics@elements@outerfactor}%
      {1+\tikzphysics@elements@dimensionoffset/\@tempdimb}%
    \pgfmathparse{abs(\geometryvalue{#1}{delta angle}-360)<0.0001?1:0}%
    \ifnum\pgfmathresult=1\relax
      \draw[every element dimension,->]
        (#1.center)--(#1.inner-start)
        node[midway,above,sloped,every element label]
          {\tikzphysics@elements@savedradiuslabel};%
      \coordinate (tikzphysics-element-dr-label) at
        ($(#1.inner-start)!2.8!(#1.outer-start)$);%
      \draw[every element dimension,->]
        (tikzphysics-element-dr-label)--(#1.outer-start);%
      \node[every element label,anchor=south]
        at (tikzphysics-element-dr-label)
        {\tikzphysics@elements@savedradiallabel};%
    \else
      \ifdim\@tempdima=0pt\relax
        \draw[every element dimension,->]
          (#1.center)--(#1.outer-start)
          node[midway,below,sloped,every element label]
            {\tikzphysics@elements@savedradiuslabel};%
        \def\tikzphysics@elements@anglefactor{0.5}%
      \else
        \draw[every element dimension,->]
          (#1.center)--(#1.inner-start)
          node[midway,below,sloped,every element label]
            {\tikzphysics@elements@savedradiuslabel};%
        \coordinate (tikzphysics-element-dr-label) at
          ($(#1.inner-end)!2.8!(#1.outer-end)$);%
        \draw[every element dimension,->]
          (tikzphysics-element-dr-label)--(#1.outer-end);%
        \node[every element label,anchor=south]
          at (tikzphysics-element-dr-label)
          {\tikzphysics@elements@savedradiallabel};%
        %% Keep the angular label in the open centre rather than on the
        %% shaded annulus, even when the annulus is very thin.
        \pgfmathsetmacro{\tikzphysics@elements@anglefactor}%
          {0.46*\@tempdima/\@tempdimb}%
      \fi
      \tikzphysics@elements@drawpolyarc{#1}{outer}{\tikzphysics@elements@outerfactor}%
      \node[every element label]
        at ($(#1.center)!\tikzphysics@elements@outerfactor!(#1.outer-50)$)
        {\tikzphysics@elements@savedarclabel};%
      \pgfmathsetmacro{\tikzphysics@elements@anglearcfactor}{.6*\tikzphysics@elements@anglefactor}%
      \tikzphysics@elements@drawpolyarc{#1}{outer}{\tikzphysics@elements@anglearcfactor}%
      \node[every element label]
        at ($(#1.center)!\tikzphysics@elements@anglefactor!(#1.outer-50)$)
        {\tikzphysics@elements@savedangularlabel};%
    \fi
  \endgroup
}

\def\tikzphysics@elements@drawstripdimensions#1{%
  \draw[every element dimension,|<->|]
    ([yshift=-4mm]#1.south west)--([yshift=-4mm]#1.south east)
    node[midway,below,every element label]
      {\tikzphysics@elements@savedcircumferencelabel};%
  \draw[every element dimension]
    ([xshift=3mm]#1.south east)--([xshift=5mm]#1.south east)
    ([xshift=4mm]#1.south east)--([xshift=4mm]#1.north east)
    ([xshift=3mm]#1.north east)--([xshift=5mm]#1.north east);%
  \node[right=5mm,every element label] at (#1.east)
    {\tikzphysics@elements@savedradiallabel};%
}

\def\tikzphysics@elements@drawrectdimensions#1{%
  \draw[every element dimension,|<->|]
    ([yshift=-4mm]#1.south west)--([yshift=-4mm]#1.south east)
    node[midway,below,every element label]
      {\tikzphysics@elements@savedwidthlabel};%
  \draw[every element dimension,|<->|]
    ([xshift=4mm]#1.south east)--([xshift=4mm]#1.north east)
    node[midway,right,every element label]
      {\tikzphysics@elements@savedheightlabel};%
}

%% ============================================================
%%  SOLID-BODY TEACHING DIAGRAM HELPERS
%% ============================================================

\newdimen\tikzphysics@elements@sliceradius
\newdimen\tikzphysics@elements@sliceradiusb
\newdimen\tikzphysics@elements@sliceposition
\newdimen\tikzphysics@elements@projectionradius

\newcommand{\tikzphysics@elements@setsoliddims}{%
  \tikzphysics@resolve@length{\tikzphysics@elements@bodyradius}%
    {\tikzphysics@elements@bodyradiusvalue}%
  \tikzphysics@resolve@length{\tikzphysics@elements@bodywidth}%
    {\tikzphysics@elements@bodywidthvalue}%
  \tikzphysics@resolve@length{\tikzphysics@elements@bodyheight}%
    {\tikzphysics@elements@bodyheightvalue}%
  \tikzphysics@resolve@length{\tikzphysics@elements@axialthickness}%
    {\tikzphysics@elements@axialthicknessvalue}%
  \pgfmathparse{\tikzphysics@elements@projectionratiovalue}%
  \ifpgfmathunitsdeclared
    \PackageError{tikzphysics}{element projection ratio must be unitless}%
      {Use a number greater than zero and at most one.}%
  \fi
  \edef\tikzphysics@elements@projectionratio{\pgfmathresult}%
  \ifdim\tikzphysics@elements@projectionratio pt>0pt\relax\else
    \PackageError{tikzphysics}{element projection ratio must be greater than zero}%
      {Use a number in the interval (0,1].}%
  \fi
  \ifdim\tikzphysics@elements@projectionratio pt>1pt\relax
    \PackageError{tikzphysics}{element projection ratio must not exceed one}%
      {Use a number in the interval (0,1].}%
  \fi
}

\newcommand{\tikzphysics@elements@setunitposition}{%
  \pgfmathparse{\tikzphysics@elements@positionvalue}%
  \ifpgfmathunitsdeclared
    \PackageError{tikzphysics}{element position must be unitless}%
      {Use a number in the interval [0,1].}%
  \fi
  \edef\tikzphysics@elements@position{\pgfmathresult}%
  \ifdim\tikzphysics@elements@position pt<0pt\relax
    \PackageError{tikzphysics}{element position must not be negative}%
      {Use a number in the interval [0,1].}%
  \fi
  \ifdim\tikzphysics@elements@position pt>1pt\relax
    \PackageError{tikzphysics}{element position must not exceed one}%
      {Use a number in the interval [0,1].}%
  \fi
}

\newcommand{\tikzphysics@elements@setsphereposition}{%
  \pgfmathparse{\tikzphysics@elements@positionvalue}%
  \ifpgfmathunitsdeclared
    \PackageError{tikzphysics}{sphere-slice position must be unitless}%
      {Use a number strictly between -1 and 1.}%
  \fi
  \edef\tikzphysics@elements@position{\pgfmathresult}%
  \pgfmathparse{abs(\tikzphysics@elements@position)<1?1:0}%
  \ifnum\pgfmathresult=1\relax\else
    \PackageError{tikzphysics}{sphere-slice position must lie between -1 and 1}%
      {The value is the signed axial position divided by the sphere radius.}%
  \fi
}

\newcommand{\tikzphysics@elements@drawformula}[2]{%
  \def\tikzphysics@elements@emptyformula{}%
  \ifx#2\tikzphysics@elements@emptyformula\else
    \node[every element label,anchor=north] at (#1) {#2};%
  \fi
}

\tikzset{
  every physics solid hidden edge/.style={draw=black!55,dashed,line width=.4pt},
  every solid hidden edge/.style={every physics solid hidden edge},
  every physics solid element/.style={draw=black,fill=white,
    pattern=north east lines,pattern color=black,line width=.5pt},
  every solid element/.style={every physics solid element},
}

%% Projected horizontal circles use a dashed rear half and solid front half.
%% Keeping these as paths preserves native TikZ styling through the two hooks.
\def\tikzphysics@elements@drawprojectedbodyellipse#1#2#3{%
  \draw[every solid hidden edge]
    (#1,#2) arc[start angle=0,end angle=180,x radius=#1,y radius=#3];%
  \draw[every element body]
    (-#1,#2) arc[start angle=180,end angle=360,x radius=#1,y radius=#3];%
}
\def\tikzphysics@elements@drawprojectedelementellipse#1#2#3{%
  \draw[every solid hidden edge]
    (#1,#2) arc[start angle=0,end angle=180,x radius=#1,y radius=#3];%
  \draw[every element dimension]
    (-#1,#2) arc[start angle=180,end angle=360,x radius=#1,y radius=#3];%
}

%% A named pic recreates the original ring-plus-unwrapped-strip teaching
%% diagram while leaving both parts available as (name-ring) and (name-strip).
\tikzset{
  pics/differential ring diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element inner radius=1cm,element outer radius=1.2cm,
      element body radius=2cm,element diagram gap=5mm,
      every differential ring diagram,#1}%
    \edef\tikzphysics@elements@picinner{\tikzphysics@elements@innervalue}%
    \edef\tikzphysics@elements@picouter{\tikzphysics@elements@outervalue}%
    \edef\tikzphysics@elements@picthickness{\tikzphysics@elements@thicknessvalue}%
    \edef\tikzphysics@elements@picthicknessflag{\tikzphysics@elements@thicknessflag}%
    \edef\tikzphysics@elements@picradiuslabel{\unexpanded\expandafter{\tikzphysics@elements@radiuslabel}}%
    \edef\tikzphysics@elements@picradiallabel{\unexpanded\expandafter{\tikzphysics@elements@radiallabel}}%
    \edef\tikzphysics@elements@piccircumferencelabel{\unexpanded\expandafter{\tikzphysics@elements@circumferencelabel}}%
    \tikzphysics@elements@setpolardims
    \tikzphysics@resolve@length{\tikzphysics@elements@bodyradius}%
      {\tikzphysics@elements@bodyradiusvalue}%
    \ifdim\tikzphysics@elements@bodyradius>\tikzphysics@elements@outer\relax\else
      \PackageError{tikzphysics}{element body radius must exceed the ring outer radius}%
        {Increase element body radius or reduce the differential ring radius.}%
    \fi
    \tikzphysics@resolve@nonnegative{\tikzphysics@elements@centerdotradius}%
      {\tikzphysics@elements@centerdotradiusvalue}%
    \tikzphysics@resolve@length{\tikzphysics@elements@diagramgap}%
      {\tikzphysics@elements@diagramgapvalue}%
    \@tempdima=\tikzphysics@elements@bodyradius
    \advance\@tempdima by \tikzphysics@elements@diagramgap
    \edef\tikzphysics@elements@picy{\the\@tempdima}%
    \draw[every element body] (0,0) circle[radius=\tikzphysics@elements@bodyradius];
    \fill[every element center] (0,0)
      circle[radius=\tikzphysics@elements@centerdotradius];
    \coordinate (-center) at (0,0);
    \coordinate (-body-north) at (0,\tikzphysics@elements@bodyradius);
    \coordinate (-body-south) at (0,-\tikzphysics@elements@bodyradius);
    \coordinate (-body-east) at (\tikzphysics@elements@bodyradius,0);
    \coordinate (-body-west) at (-\tikzphysics@elements@bodyradius,0);
    \ifnum\tikzphysics@elements@picthicknessflag=1\relax
      \node[differential ring,
        element inner radius=\tikzphysics@elements@picinner,
        element radial thickness=\tikzphysics@elements@picthickness,
        element radius label={\tikzphysics@elements@picradiuslabel},
        element radial label={\tikzphysics@elements@picradiallabel},
        show dimensions] (-ring) {};
      \node[unwrapped ring,
        element inner radius=\tikzphysics@elements@picinner,
        element radial thickness=\tikzphysics@elements@picthickness,
        element radial label={\tikzphysics@elements@picradiallabel},
        element circumference label={\tikzphysics@elements@piccircumferencelabel},
        show dimensions,anchor=north] (-strip) at (0,-\tikzphysics@elements@picy) {};
    \else
      \node[differential ring,
        element inner radius=\tikzphysics@elements@picinner,
        element outer radius=\tikzphysics@elements@picouter,
        element radius label={\tikzphysics@elements@picradiuslabel},
        element radial label={\tikzphysics@elements@picradiallabel},
        show dimensions] (-ring) {};
      \node[unwrapped ring,
        element inner radius=\tikzphysics@elements@picinner,
        element outer radius=\tikzphysics@elements@picouter,
        element radial label={\tikzphysics@elements@picradiallabel},
        element circumference label={\tikzphysics@elements@piccircumferencelabel},
        show dimensions,anchor=north] (-strip) at (0,-\tikzphysics@elements@picy) {};
    \fi
  }},
  pics/differential ring diagram/.default={},
  pics/physics differential ring diagram/.style args={#1}{differential ring diagram={#1}},
  pics/physics differential ring diagram/.default={},
}

%% Complete solid-body constructions. The highlighted differential part is a
%% named node whenever its 2-D section is rectangular or annular.
\tikzset{
  pics/sphere shell diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element inner radius=1cm,element radial thickness=1.5mm,
      element body radius=2cm,
      element formula label={$dV=4\pi r^2\,d\!r$},
      every sphere shell diagram,#1}%
    \edef\tikzphysics@elements@picinner{\tikzphysics@elements@innervalue}%
    \edef\tikzphysics@elements@picthickness{\tikzphysics@elements@thicknessvalue}%
    \edef\tikzphysics@elements@picradiuslabel{\unexpanded\expandafter{\tikzphysics@elements@radiuslabel}}%
    \edef\tikzphysics@elements@picradiallabel{\unexpanded\expandafter{\tikzphysics@elements@radiallabel}}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \tikzphysics@elements@setpolardims
    \tikzphysics@resolve@length{\tikzphysics@elements@bodyradius}%
      {\tikzphysics@elements@bodyradiusvalue}%
    \ifdim\tikzphysics@elements@outer<\tikzphysics@elements@bodyradius\relax\else
      \PackageError{tikzphysics}{spherical shell must lie inside the sphere body}%
        {Reduce the shell radius or increase element body radius.}%
    \fi
    \@tempdima=2\tikzphysics@elements@bodyradius
    \edef\tikzphysics@elements@bodydiameter{\the\@tempdima}%
    \node[circle,minimum size=\tikzphysics@elements@bodydiameter,
      inner sep=0pt,outer sep=0pt,every element body] (-body) {};
    \fill[every element center] (0,0)
      circle[radius=\tikzphysics@elements@centerdotradiusvalue];
    \node[spherical shell,
      element inner radius=\tikzphysics@elements@picinner,
      element radial thickness=\tikzphysics@elements@picthickness,
      element radius label={\tikzphysics@elements@picradiuslabel},
      element radial label={\tikzphysics@elements@picradiallabel},
      show dimensions] (-shell) {};
    \coordinate (-center) at (0,0);
    \coordinate (-formula-anchor) at ([yshift=-7mm]-body.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/sphere shell diagram/.default={},
  pics/physics sphere shell diagram/.style args={#1}{sphere shell diagram={#1}},
  pics/physics sphere shell diagram/.default={},
  pics/hollow sphere diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element inner radius=9mm,element outer radius=2cm,
      element formula label={$V={4\pi\over3}(R^3-a^3)$},
      every hollow sphere diagram,#1}%
    \edef\tikzphysics@elements@picinner{\tikzphysics@elements@innervalue}%
    \edef\tikzphysics@elements@picouter{\tikzphysics@elements@outervalue}%
    \edef\tikzphysics@elements@picbodylabel{\unexpanded\expandafter{\tikzphysics@elements@bodyradiuslabel}}%
    \edef\tikzphysics@elements@piccavitylabel{\unexpanded\expandafter{\tikzphysics@elements@cavityradiuslabel}}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \node[hollow sphere,
      element inner radius=\tikzphysics@elements@picinner,
      element outer radius=\tikzphysics@elements@picouter] (-wall) {};
    \fill[every element center] (0,0)
      circle[radius=\tikzphysics@elements@centerdotradiusvalue];
    \draw[every element dimension,->] (-wall.center)--(-wall.inner-0)
      node[midway,above,sloped,every element label]
        {\tikzphysics@elements@piccavitylabel};
    \draw[every element dimension,->] (-wall.center)--(-wall.outer-30)
      node[midway,above,sloped,every element label]
        {\tikzphysics@elements@picbodylabel};
    \coordinate (-center) at (-wall.center);
    \coordinate (-body-north) at (-wall.north);
    \coordinate (-body-south) at (-wall.south);
    \coordinate (-formula-anchor) at ([yshift=-7mm]-wall.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/hollow sphere diagram/.default={},
  pics/physics hollow sphere diagram/.style args={#1}{hollow sphere diagram={#1}},
  pics/physics hollow sphere diagram/.default={},
  pics/sphere slice diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element body radius=2cm,element axial thickness=2mm,
      element position=.35,element projection ratio=.24,
      element formula label={$dV=\pi y^2\,d\!x$},
      every sphere slice diagram,#1}%
    \edef\tikzphysics@elements@picaxiallabel{\unexpanded\expandafter{\tikzphysics@elements@axiallabel}}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \tikzphysics@elements@setsoliddims
    \tikzphysics@elements@setsphereposition
    \ifdim\tikzphysics@elements@axialthickness<\tikzphysics@elements@bodyradius\relax\else
      \PackageError{tikzphysics}{sphere-slice thickness is too large}%
        {Use an axial thickness smaller than the sphere radius.}%
    \fi
    \pgfmathparse{abs(\tikzphysics@elements@position)+
      .5*\tikzphysics@elements@axialthickness/\tikzphysics@elements@bodyradius<1?1:0}%
    \ifnum\pgfmathresult=1\relax\else
      \PackageError{tikzphysics}{sphere slice extends beyond the sphere body}%
        {Move element position toward zero or reduce element axial thickness.}%
    \fi
    \pgfmathsetlength{\tikzphysics@elements@sliceposition}%
      {\tikzphysics@elements@position*\tikzphysics@elements@bodyradius}%
    \pgfmathsetlength{\tikzphysics@elements@sliceradius}%
      {sqrt(1-(\tikzphysics@elements@position)^2)*\tikzphysics@elements@bodyradius}%
    \pgfmathsetlength{\tikzphysics@elements@projectionradius}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@sliceradius}%
    \@tempdima=2\tikzphysics@elements@bodyradius
    \edef\tikzphysics@elements@bodydiameter{\the\@tempdima}%
    \@tempdima=2\tikzphysics@elements@sliceradius
    \edef\tikzphysics@elements@slicediameter{\the\@tempdima}%
    \node[circle,minimum size=\tikzphysics@elements@bodydiameter,
      inner sep=0pt,outer sep=0pt,every element body] (-body) {};
    \node[rectangular element,
      element width=\tikzphysics@elements@axialthickness,
      element height=\tikzphysics@elements@slicediameter] (-slice)
      at (\tikzphysics@elements@sliceposition,0) {};
    \begin{scope}[xshift=\tikzphysics@elements@sliceposition]
      \tikzphysics@elements@drawprojectedelementellipse
        {\tikzphysics@elements@projectionradius}{0}
        {\tikzphysics@elements@sliceradius}
    \end{scope}
    \draw[every element dimension,->] (0,0)--(\tikzphysics@elements@sliceposition,0)
      node[midway,above,every element label] {$x$};
    \draw[every element dimension,->] (-slice.center)--(-slice.north)
      node[midway,left,every element label] {$y$};
    \draw[every element dimension]
      ([yshift=-3mm]-slice.south west)--([yshift=-6mm]-slice.south west)
      ([yshift=-3mm]-slice.south east)--([yshift=-6mm]-slice.south east)
      ([yshift=-4.5mm]-slice.south west)--([yshift=-4.5mm]-slice.south east);
    \node[below=6mm,every element label] at (-slice.south)
      {\tikzphysics@elements@picaxiallabel};
    \fill[every element center] (0,0)
      circle[radius=\tikzphysics@elements@centerdotradiusvalue];
    \coordinate (-center) at (0,0);
    \coordinate (-formula-anchor) at ([yshift=-11mm]-body.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/sphere slice diagram/.default={},
  pics/physics sphere slice diagram/.style args={#1}{sphere slice diagram={#1}},
  pics/physics sphere slice diagram/.default={},
}

\tikzset{
  pics/cylinder shell diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element body radius=1.6cm,element body height=3.4cm,
      element inner radius=9mm,element radial thickness=1.5mm,
      element projection ratio=.25,
      element formula label={$dV=2\pi r h\,d\!r$},
      every cylinder shell diagram,#1}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \edef\tikzphysics@elements@picradiuslabel{\unexpanded\expandafter{\tikzphysics@elements@radiuslabel}}%
    \edef\tikzphysics@elements@picradiallabel{\unexpanded\expandafter{\tikzphysics@elements@radiallabel}}%
    \tikzphysics@elements@setsoliddims
    \tikzphysics@elements@setpolardims
    \ifdim\tikzphysics@elements@outer<\tikzphysics@elements@bodyradius\relax\else
      \PackageError{tikzphysics}{cylindrical shell must lie inside the cylinder body}%
        {Reduce the shell radius or increase element body radius.}%
    \fi
    \pgfmathsetlength{\tikzphysics@elements@projectionradius}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@bodyradius}%
    \pgfmathsetlength{\@tempdima}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@inner}%
    \edef\tikzphysics@elements@innerprojection{\the\@tempdima}%
    \pgfmathsetlength{\@tempdima}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@outer}%
    \edef\tikzphysics@elements@outerprojection{\the\@tempdima}%
    \@tempdima=.5\tikzphysics@elements@bodyheight
    \edef\tikzphysics@elements@bodytop{\the\@tempdima}%
    \@tempdima=-.5\tikzphysics@elements@bodyheight
    \edef\tikzphysics@elements@bodybottom{\the\@tempdima}%
    \@tempdima=2\tikzphysics@elements@bodyradius
    \edef\tikzphysics@elements@bodydiameter{\the\@tempdima}%
    \@tempdima=\tikzphysics@elements@bodyheight
    \advance\@tempdima by 2\tikzphysics@elements@projectionradius
    \edef\tikzphysics@elements@bodytotalheight{\the\@tempdima}%
    \node[draw=none,inner sep=0pt,outer sep=0pt,
      minimum width=\tikzphysics@elements@bodydiameter,
      minimum height=\tikzphysics@elements@bodytotalheight] (-body) {};
    \draw[every element body]
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodybottom)--
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodytop)
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodybottom)--
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodytop);
    \tikzphysics@elements@drawprojectedbodyellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@bodytop}
      {\tikzphysics@elements@projectionradius}
    \tikzphysics@elements@drawprojectedbodyellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@bodybottom}
      {\tikzphysics@elements@projectionradius}
    \path[every solid element]
      (-\tikzphysics@elements@outer,\tikzphysics@elements@bodybottom) rectangle
      (-\tikzphysics@elements@inner,\tikzphysics@elements@bodytop)
      (\tikzphysics@elements@inner,\tikzphysics@elements@bodybottom) rectangle
      (\tikzphysics@elements@outer,\tikzphysics@elements@bodytop);
    \path[every solid element,draw=none,even odd rule]
      (0,\tikzphysics@elements@bodytop)
        ellipse[x radius=\tikzphysics@elements@outer,
                y radius=\tikzphysics@elements@outerprojection]
      (0,\tikzphysics@elements@bodytop)
        ellipse[x radius=\tikzphysics@elements@inner,
                y radius=\tikzphysics@elements@innerprojection];
    \tikzphysics@elements@drawprojectedelementellipse
      {\tikzphysics@elements@outer}{\tikzphysics@elements@bodytop}
      {\tikzphysics@elements@outerprojection}
    \tikzphysics@elements@drawprojectedelementellipse
      {\tikzphysics@elements@inner}{\tikzphysics@elements@bodytop}
      {\tikzphysics@elements@innerprojection}
    \draw[every element dimension]
      (0,\tikzphysics@elements@bodybottom)--(\tikzphysics@elements@inner,\tikzphysics@elements@bodybottom)
      node[midway,below,every element label]{\tikzphysics@elements@picradiuslabel};
    \draw[every element dimension,|<->|]
      (\tikzphysics@elements@inner,\tikzphysics@elements@bodytop)--
      (\tikzphysics@elements@outer,\tikzphysics@elements@bodytop)
      node[midway,above,every element label]{\tikzphysics@elements@picradiallabel};
    \draw[every element dimension]
      ([xshift=-4mm]-body.south west)--([xshift=-7mm]-body.south west)
      ([xshift=-4mm]-body.north west)--([xshift=-7mm]-body.north west)
      ([xshift=-5.5mm]-body.south west)--([xshift=-5.5mm]-body.north west);
    \node[left=8mm,every element label] at (-body.west) {$h$};
    \node[draw=none,inner sep=0pt,outer sep=0pt,
      minimum width=2\tikzphysics@elements@outer,
      minimum height=\tikzphysics@elements@bodyheight] (-shell) {};
    \coordinate (-center) at (0,0);
    \coordinate (-formula-anchor) at ([yshift=-7mm]-body.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/cylinder shell diagram/.default={},
  pics/physics cylinder shell diagram/.style args={#1}{cylinder shell diagram={#1}},
  pics/physics cylinder shell diagram/.default={},
  pics/cylinder slice diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element body radius=1.6cm,element body height=3.4cm,
      element axial thickness=2mm,element position=.55,
      element projection ratio=.25,element axial label={$d\!z$},
      element formula label={$dV=\pi R^2\,d\!z$},
      every cylinder slice diagram,#1}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \edef\tikzphysics@elements@picaxiallabel{\unexpanded\expandafter{\tikzphysics@elements@axiallabel}}%
    \tikzphysics@elements@setsoliddims
    \tikzphysics@elements@setunitposition
    \ifdim\tikzphysics@elements@axialthickness<\tikzphysics@elements@bodyheight\relax\else
      \PackageError{tikzphysics}{cylinder-slice thickness must be smaller than body height}%
        {Reduce element axial thickness.}%
    \fi
    \pgfmathparse{\tikzphysics@elements@position-
      .5*\tikzphysics@elements@axialthickness/\tikzphysics@elements@bodyheight>=0 &&
      \tikzphysics@elements@position+
      .5*\tikzphysics@elements@axialthickness/\tikzphysics@elements@bodyheight<=1?1:0}%
    \ifnum\pgfmathresult=1\relax\else
      \PackageError{tikzphysics}{cylinder slice extends beyond the cylinder body}%
        {Move element position away from the end or reduce element axial thickness.}%
    \fi
    \pgfmathsetlength{\tikzphysics@elements@projectionradius}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@bodyradius}%
    \@tempdima=.5\tikzphysics@elements@bodyheight
    \edef\tikzphysics@elements@bodytop{\the\@tempdima}%
    \@tempdima=-.5\tikzphysics@elements@bodyheight
    \edef\tikzphysics@elements@bodybottom{\the\@tempdima}%
    \pgfmathsetlength{\tikzphysics@elements@sliceposition}%
      {-.5*\tikzphysics@elements@bodyheight+
       \tikzphysics@elements@position*\tikzphysics@elements@bodyheight}%
    \@tempdima=\tikzphysics@elements@sliceposition
    \advance\@tempdima by .5\tikzphysics@elements@axialthickness
    \edef\tikzphysics@elements@slicetop{\the\@tempdima}%
    \@tempdima=\tikzphysics@elements@sliceposition
    \advance\@tempdima by -.5\tikzphysics@elements@axialthickness
    \edef\tikzphysics@elements@slicebottom{\the\@tempdima}%
    \@tempdima=2\tikzphysics@elements@bodyradius
    \edef\tikzphysics@elements@bodydiameter{\the\@tempdima}%
    \@tempdima=\tikzphysics@elements@bodyheight
    \advance\@tempdima by 2\tikzphysics@elements@projectionradius
    \edef\tikzphysics@elements@bodytotalheight{\the\@tempdima}%
    \node[draw=none,inner sep=0pt,outer sep=0pt,
      minimum width=\tikzphysics@elements@bodydiameter,
      minimum height=\tikzphysics@elements@bodytotalheight] (-body) {};
    \draw[every element body]
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodybottom)--
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodytop)
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodybottom)--
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@bodytop);
    \tikzphysics@elements@drawprojectedbodyellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@bodytop}
      {\tikzphysics@elements@projectionradius}
    \tikzphysics@elements@drawprojectedbodyellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@bodybottom}
      {\tikzphysics@elements@projectionradius}
    \path[every solid element,draw=none]
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@slicebottom) rectangle
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@slicetop);
    \path[every solid element,draw=none] (0,\tikzphysics@elements@slicetop)
      ellipse[x radius=\tikzphysics@elements@bodyradius,y radius=\tikzphysics@elements@projectionradius];
    \draw[every element dimension]
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@slicebottom)--
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@slicetop)
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@slicebottom)--
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@slicetop);
    \tikzphysics@elements@drawprojectedelementellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@slicetop}
      {\tikzphysics@elements@projectionradius}
    \tikzphysics@elements@drawprojectedelementellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@slicebottom}
      {\tikzphysics@elements@projectionradius}
    \node[draw=none,inner sep=0pt,outer sep=0pt,
      minimum width=\tikzphysics@elements@bodydiameter,
      minimum height=\tikzphysics@elements@axialthickness] (-slice)
      at (0,\tikzphysics@elements@sliceposition) {};
    \draw[every element dimension]
      ([xshift=3mm]-slice.south east)--([xshift=6mm]-slice.south east)
      ([xshift=3mm]-slice.north east)--([xshift=6mm]-slice.north east)
      ([xshift=4.5mm]-slice.south east)--([xshift=4.5mm]-slice.north east);
    \node[right=7mm,every element label] at (-slice.east)
      {\tikzphysics@elements@picaxiallabel};
    \draw[every element dimension,->] (-slice.center)--(-slice.east)
      node[midway,above,every element label]{\tikzphysics@elements@bodyradiuslabel};
    \coordinate (-center) at (0,0);
    \coordinate (-formula-anchor) at ([yshift=-7mm]-body.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/cylinder slice diagram/.default={},
  pics/physics cylinder slice diagram/.style args={#1}{cylinder slice diagram={#1}},
  pics/physics cylinder slice diagram/.default={},
}

\tikzset{
  pics/cone slice diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element body radius=1.8cm,element body height=4cm,
      element axial thickness=2mm,element position=.58,
      element projection ratio=.24,
      element formula label={$dV=\pi r(x)^2\,d\!x$},
      every cone slice diagram,#1}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \edef\tikzphysics@elements@picaxiallabel{\unexpanded\expandafter{\tikzphysics@elements@axiallabel}}%
    \edef\tikzphysics@elements@picradiuslabel{\unexpanded\expandafter{\tikzphysics@elements@radiuslabel}}%
    \tikzphysics@elements@setsoliddims
    \tikzphysics@elements@setunitposition
    \ifdim\tikzphysics@elements@position pt>0pt\relax\else
      \PackageError{tikzphysics}{cone-slice position must be greater than zero}%
        {Use a number in the interval (0,1).}%
    \fi
    \ifdim\tikzphysics@elements@position pt<1pt\relax\else
      \PackageError{tikzphysics}{cone-slice position must be less than one}%
        {Use a number in the interval (0,1).}%
    \fi
    \pgfmathsetlength{\tikzphysics@elements@sliceposition}%
      {.5*\tikzphysics@elements@bodyheight-
       \tikzphysics@elements@position*\tikzphysics@elements@bodyheight}%
    \pgfmathsetlength{\tikzphysics@elements@sliceradius}%
      {\tikzphysics@elements@position*\tikzphysics@elements@bodyradius}%
    \pgfmathsetmacro{\tikzphysics@elements@positionb}%
      {\tikzphysics@elements@position+
       \tikzphysics@elements@axialthickness/\tikzphysics@elements@bodyheight}%
    \ifdim\tikzphysics@elements@positionb pt<1pt\relax\else
      \PackageError{tikzphysics}{cone slice extends beyond the base}%
        {Reduce element axial thickness or element position.}%
    \fi
    \pgfmathsetlength{\tikzphysics@elements@sliceradiusb}%
      {\tikzphysics@elements@positionb*\tikzphysics@elements@bodyradius}%
    \pgfmathsetlength{\tikzphysics@elements@projectionradius}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@bodyradius}%
    \pgfmathsetlength{\@tempdima}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@sliceradius}%
    \edef\tikzphysics@elements@sliceprojection{\the\@tempdima}%
    \pgfmathsetlength{\@tempdima}%
      {\tikzphysics@elements@projectionratio*\tikzphysics@elements@sliceradiusb}%
    \edef\tikzphysics@elements@sliceprojectionb{\the\@tempdima}%
    \@tempdima=.5\tikzphysics@elements@bodyheight
    \edef\tikzphysics@elements@apexy{\the\@tempdima}%
    \@tempdima=-.5\tikzphysics@elements@bodyheight
    \edef\tikzphysics@elements@basey{\the\@tempdima}%
    \@tempdima=\tikzphysics@elements@sliceposition
    \advance\@tempdima by -\tikzphysics@elements@axialthickness
    \edef\tikzphysics@elements@slicebottom{\the\@tempdima}%
    \@tempdima=2\tikzphysics@elements@bodyradius
    \edef\tikzphysics@elements@bodydiameter{\the\@tempdima}%
    \@tempdima=\tikzphysics@elements@bodyheight
    \advance\@tempdima by 2\tikzphysics@elements@projectionradius
    \edef\tikzphysics@elements@bodytotalheight{\the\@tempdima}%
    \node[draw=none,inner sep=0pt,outer sep=0pt,
      minimum width=\tikzphysics@elements@bodydiameter,
      minimum height=\tikzphysics@elements@bodytotalheight] (-body) {};
    \draw[every element body]
      (0,\tikzphysics@elements@apexy)--
      (-\tikzphysics@elements@bodyradius,\tikzphysics@elements@basey)
      (0,\tikzphysics@elements@apexy)--
      (\tikzphysics@elements@bodyradius,\tikzphysics@elements@basey);
    \tikzphysics@elements@drawprojectedbodyellipse
      {\tikzphysics@elements@bodyradius}{\tikzphysics@elements@basey}
      {\tikzphysics@elements@projectionradius}
    \path[every solid element,draw=none]
      (-\tikzphysics@elements@sliceradius,\tikzphysics@elements@sliceposition)--
      (-\tikzphysics@elements@sliceradiusb,\tikzphysics@elements@slicebottom)--
      (\tikzphysics@elements@sliceradiusb,\tikzphysics@elements@slicebottom)--
      (\tikzphysics@elements@sliceradius,\tikzphysics@elements@sliceposition)--cycle;
    \path[every solid element,draw=none] (0,\tikzphysics@elements@sliceposition)
      ellipse[x radius=\tikzphysics@elements@sliceradius,
              y radius=\tikzphysics@elements@sliceprojection];
    \draw[every element dimension]
      (-\tikzphysics@elements@sliceradius,\tikzphysics@elements@sliceposition)--
      (-\tikzphysics@elements@sliceradiusb,\tikzphysics@elements@slicebottom)
      (\tikzphysics@elements@sliceradius,\tikzphysics@elements@sliceposition)--
      (\tikzphysics@elements@sliceradiusb,\tikzphysics@elements@slicebottom);
    \tikzphysics@elements@drawprojectedelementellipse
      {\tikzphysics@elements@sliceradius}{\tikzphysics@elements@sliceposition}
      {\tikzphysics@elements@sliceprojection}
    \tikzphysics@elements@drawprojectedelementellipse
      {\tikzphysics@elements@sliceradiusb}{\tikzphysics@elements@slicebottom}
      {\tikzphysics@elements@sliceprojectionb}
    \@tempdima=2\tikzphysics@elements@sliceradiusb
    \edef\tikzphysics@elements@slicediameter{\the\@tempdima}%
    \@tempdima=\tikzphysics@elements@sliceposition
    \advance\@tempdima by \tikzphysics@elements@slicebottom
    \divide\@tempdima by 2
    \edef\tikzphysics@elements@slicecenter{\the\@tempdima}%
    \node[draw=none,inner sep=0pt,outer sep=0pt,
      minimum width=\tikzphysics@elements@slicediameter,
      minimum height=\tikzphysics@elements@axialthickness] (-slice)
      at (0,\tikzphysics@elements@slicecenter) {};
    \draw[every element dimension,->]
      (0,\tikzphysics@elements@sliceposition)--
      (\tikzphysics@elements@sliceradius,\tikzphysics@elements@sliceposition)
      node[midway,above,every element label]{\tikzphysics@elements@picradiuslabel};
    \draw[every element dimension]
      ([xshift=3mm]-slice.south east)--([xshift=6mm]-slice.south east)
      ([xshift=3mm]-slice.north east)--([xshift=6mm]-slice.north east)
      ([xshift=4.5mm]-slice.south east)--([xshift=4.5mm]-slice.north east);
    \node[right=7mm,every element label] at (-slice.east)
      {\tikzphysics@elements@picaxiallabel};
    \coordinate (-apex) at (0,\tikzphysics@elements@apexy);
    \coordinate (-base) at (0,\tikzphysics@elements@basey);
    \coordinate (-center) at (0,0);
    \coordinate (-formula-anchor) at ([yshift=-7mm]-body.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/cone slice diagram/.default={},
  pics/physics cone slice diagram/.style args={#1}{cone slice diagram={#1}},
  pics/physics cone slice diagram/.default={},
  pics/sheet element diagram/.style args={#1}{code={%
    \tikzset{physics element defaults,
      element body width=5cm,element body height=3cm,
      element width=8mm,element height=6mm,
      element position=.58,element transverse position=.58,
      element formula label={$dA=d\!x\,d\!y$},
      every sheet element diagram,#1}%
    \edef\tikzphysics@elements@picwidth{\tikzphysics@elements@widthvalue}%
    \edef\tikzphysics@elements@picheight{\tikzphysics@elements@heightvalue}%
    \edef\tikzphysics@elements@picwidthlabel{\unexpanded\expandafter{\tikzphysics@elements@widthlabel}}%
    \edef\tikzphysics@elements@picheightlabel{\unexpanded\expandafter{\tikzphysics@elements@heightlabel}}%
    \edef\tikzphysics@elements@picformula{\unexpanded\expandafter{\tikzphysics@elements@formulalabel}}%
    \tikzphysics@elements@setsoliddims
    \tikzphysics@elements@setrectdims
    \tikzphysics@elements@setunitposition
    \pgfmathparse{\tikzphysics@elements@transversepositionvalue}%
    \ifpgfmathunitsdeclared
      \PackageError{tikzphysics}{element transverse position must be unitless}%
        {Use a number in the interval [0,1].}%
    \fi
    \edef\tikzphysics@elements@transverseposition{\pgfmathresult}%
    \ifdim\tikzphysics@elements@transverseposition pt<0pt\relax
      \PackageError{tikzphysics}{element transverse position must not be negative}%
        {Use a number in the interval [0,1].}%
    \fi
    \ifdim\tikzphysics@elements@transverseposition pt>1pt\relax
      \PackageError{tikzphysics}{element transverse position must not exceed one}%
        {Use a number in the interval [0,1].}%
    \fi
    \ifdim\tikzphysics@elements@rectwidth<\tikzphysics@elements@bodywidth\relax\else
      \PackageError{tikzphysics}{rectangular element must be narrower than its sheet}%
        {Reduce element width or increase element body width.}%
    \fi
    \ifdim\tikzphysics@elements@rectheight<\tikzphysics@elements@bodyheight\relax\else
      \PackageError{tikzphysics}{rectangular element must be shorter than its sheet}%
        {Reduce element height or increase element body height.}%
    \fi
    \pgfmathsetlength{\@tempdima}%
      {-.5*\tikzphysics@elements@bodywidth+.5*\tikzphysics@elements@rectwidth+
       \tikzphysics@elements@position*(\tikzphysics@elements@bodywidth-\tikzphysics@elements@rectwidth)}%
    \edef\tikzphysics@elements@elementx{\the\@tempdima}%
    \pgfmathsetlength{\@tempdima}%
      {-.5*\tikzphysics@elements@bodyheight+.5*\tikzphysics@elements@rectheight+
       \tikzphysics@elements@transverseposition*(\tikzphysics@elements@bodyheight-\tikzphysics@elements@rectheight)}%
    \edef\tikzphysics@elements@elementy{\the\@tempdima}%
    \node[rectangular sheet,
      element width=\tikzphysics@elements@bodywidth,
      element height=\tikzphysics@elements@bodyheight] (-body) {};
    \node[rectangular element,
      element width=\tikzphysics@elements@picwidth,
      element height=\tikzphysics@elements@picheight,
      element width label={\tikzphysics@elements@picwidthlabel},
      element height label={\tikzphysics@elements@picheightlabel},
      show dimensions] (-element)
      at (\tikzphysics@elements@elementx,\tikzphysics@elements@elementy) {};
    \coordinate (-center) at (-body.center);
    \coordinate (-formula-anchor) at ([yshift=-8mm]-body.south);
    \tikzphysics@elements@drawformula{-formula-anchor}{\tikzphysics@elements@picformula}%
  }},
  pics/sheet element diagram/.default={},
  pics/physics sheet element diagram/.style args={#1}{sheet element diagram={#1}},
  pics/physics sheet element diagram/.default={},
}

%% ============================================================
%%  DEBUG AND REFERENCE REGISTRATION
%% ============================================================

\def\tikzphysics@elements@polaranchors{%
  center,centroid,inner-start,inner-mid,inner-end,
  outer-start,outer-mid,outer-end,start-mid,end-mid,
  north,south,east,west}
\tikzphysics@registeranchors{physicspolarelement}{\tikzphysics@elements@polaranchors}
\tikzphysics@registeranchors{physicsdifferentialsector}{\tikzphysics@elements@polaranchors}
\tikzphysics@registeranchors{physicsdifferentialring}{\tikzphysics@elements@polaranchors}
\tikzphysics@registeranchors{physicssphericalshell}{\tikzphysics@elements@polaranchors}
\tikzphysics@registeranchors{physicshollowsphere}{\tikzphysics@elements@polaranchors}
\tikzphysics@registeranchors{physicsunwrappedring}{%
  center,centroid,top-left,top-right,bottom-left,bottom-right,
  north,south,east,west}
\def\tikzphysics@elements@rectanchors{%
  center,centroid,top-left,top-right,bottom-left,bottom-right,
  north,south,east,west}
\tikzphysics@registeranchors{physicsrectangularelement}{\tikzphysics@elements@rectanchors}
\tikzphysics@registeranchors{physicsrectangularstrip}{\tikzphysics@elements@rectanchors}
\tikzphysics@registeranchors{physicsrectangularsheet}{\tikzphysics@elements@rectanchors}

\tikzphysics@registerdisplayname{physicspolarelement}{polar element}
\tikzphysics@registerdisplayname{physicsdifferentialsector}{differential sector}
\tikzphysics@registerdisplayname{physicsdifferentialring}{differential ring}
\tikzphysics@registerdisplayname{physicsunwrappedring}{unwrapped ring}
\tikzphysics@registerdisplayname{physicssphericalshell}{spherical shell}
\tikzphysics@registerdisplayname{physicshollowsphere}{hollow sphere}
\tikzphysics@registerdisplayname{physicsrectangularelement}{rectangular element}
\tikzphysics@registerdisplayname{physicsrectangularstrip}{rectangular strip}
\tikzphysics@registerdisplayname{physicsrectangularsheet}{rectangular sheet}
\tikzphysics@registerdisplayname{physicsdifferentialringdiagram}{differential ring diagram}
\tikzphysics@registerdisplayname{physicssphereshelldiagram}{sphere shell diagram}
\tikzphysics@registerdisplayname{physicssphereslicediagram}{sphere slice diagram}
\tikzphysics@registerdisplayname{physicshollowspherediagram}{hollow sphere diagram}
\tikzphysics@registerdisplayname{physicscylindershelldiagram}{cylinder shell diagram}
\tikzphysics@registerdisplayname{physicscylinderslicediagram}{cylinder slice diagram}
\tikzphysics@registerdisplayname{physicsconeslicediagram}{cone slice diagram}
\tikzphysics@registerdisplayname{physicssheetelementdiagram}{sheet element diagram}

\def\tikzphysics@elements@polarkeys{%
  element inner radius,element outer radius,element radial thickness,
  element start angle,element delta angle,element dimension offset,
  element radius label,element radial label,element angular label,
  element arc label,show dimensions}
\def\tikzphysics@elements@polardefaults{%
  element inner radius/1.8cm,element outer radius/2cm,
  element radial thickness/derived,element start angle/30 degrees,
  element delta angle/30 degrees,element dimension offset/4mm,
  element radius label/r,element radial label/dr,
  element angular label/d theta,element arc label/r d theta,
  show dimensions/off}
\tikzphysics@registerkeys{physicspolarelement}{\tikzphysics@elements@polarkeys}
\tikzphysics@registerkeys{physicsdifferentialsector}{\tikzphysics@elements@polarkeys}
\tikzphysics@registerkeys{physicsdifferentialring}{\tikzphysics@elements@polarkeys}
\tikzphysics@registerkeys{physicssphericalshell}{\tikzphysics@elements@polarkeys}
\tikzphysics@registerkeys{physicshollowsphere}{\tikzphysics@elements@polarkeys}
\tikzphysics@registerkeys{physicsunwrappedring}{%
  element inner radius,element outer radius,element radial thickness,
  source element,element circumference label,element radial label,show dimensions}
\tikzphysics@registerkeys{physicsrectangularelement}{%
  element width,element height,element width label,element height label,show dimensions}
\tikzphysics@registerkeys{physicsrectangularstrip}{%
  element width,element height,element width label,element height label,show dimensions}
\tikzphysics@registerkeys{physicsrectangularsheet}{element width,element height}
\tikzphysics@registerkeydefaults{physicspolarelement}{%
  element inner radius/1.8cm,element outer radius/2cm,
  element radial thickness/derived,element start angle/30 degrees,
  element delta angle/30 degrees,element dimension offset/4mm,
  element radius label/r,element radial label/dr,
  element angular label/d theta,element arc label/r d theta,
  show dimensions/off}
\tikzphysics@registerkeydefaults{physicsdifferentialsector}{%
  element inner radius/0cm,element outer radius/2cm,
  element radial thickness/derived,element start angle/30 degrees,
  element delta angle/30 degrees,element dimension offset/4mm,
  element radius label/r,element angular label/d theta,
  element arc label/r d theta,show dimensions/off}
\tikzphysics@registerkeydefaults{physicsdifferentialring}{%
  element inner radius/1.8cm,element outer radius/2cm,
  element radial thickness/derived,element delta angle/360 degrees,
  element radius label/r,element radial label/dr,show dimensions/off}
\tikzphysics@registerkeydefaults{physicsunwrappedring}{%
  element inner radius/1.8cm,element outer radius/2cm,
  element radial thickness/derived,source element/optional named element,
  element circumference label/2 pi r,element radial label/dr,
  show dimensions/off}
\tikzphysics@registerkeydefaults{physicssphericalshell}{%
  element inner radius/1cm,element outer radius/derived,
  element radial thickness/1.5mm,element delta angle/360 degrees,
  element radius label/r,element radial label/dr,show dimensions/off}
\tikzphysics@registerkeydefaults{physicshollowsphere}{%
  element inner radius/1cm,element outer radius/2cm,
  element radial thickness/derived,element delta angle/360 degrees,
  element cavity radius label/a,element body radius label/R,
  show dimensions/off}
\tikzphysics@registerkeydefaults{physicsrectangularelement}{%
  element width/8mm,element height/6mm,
  element width label/dx,element height label/dy,show dimensions/off}
\tikzphysics@registerkeydefaults{physicsrectangularstrip}{%
  element width/4cm,element height/2mm,
  element width label/b,element height label/dx,show dimensions/off}
\tikzphysics@registerkeydefaults{physicsrectangularsheet}{%
  element width/5cm,element height/3cm}
\tikzphysics@registerkeydefaults{physicsdifferentialringdiagram}{%
  element inner radius/1cm,element outer radius/1.2cm,
  element radial thickness/derived,element body radius/2cm,
  element diagram gap/5mm,element center dot radius/1.2pt,
  show dimensions/on for both parts}
\tikzphysics@registerkeydefaults{physicssphereshelldiagram}{%
  element body radius/2cm,element inner radius/1cm,
  element radial thickness/1.5mm,element formula label/dV = 4 pi r squared dr}
\tikzphysics@registerkeydefaults{physicshollowspherediagram}{%
  element inner radius/9mm,element outer radius/2cm,
  element cavity radius label/a,element body radius label/R,
  element formula label/V = 4 pi over 3 times (R cubed - a cubed)}
\tikzphysics@registerkeydefaults{physicssphereslicediagram}{%
  element body radius/2cm,element axial thickness/2mm,
  element position/0.35 in (-1,1),element projection ratio/0.24,
  element axial label/dx,element formula label/dV = pi y squared dx}
\tikzphysics@registerkeydefaults{physicscylindershelldiagram}{%
  element body radius/1.6cm,element body height/3.4cm,
  element inner radius/9mm,element radial thickness/1.5mm,
  element projection ratio/0.25,element formula label/dV = 2 pi r h dr}
\tikzphysics@registerkeydefaults{physicscylinderslicediagram}{%
  element body radius/1.6cm,element body height/3.4cm,
  element axial thickness/2mm,element position/0.55,
  element projection ratio/0.25,element axial label/dz,
  element formula label/dV = pi R squared dz}
\tikzphysics@registerkeydefaults{physicsconeslicediagram}{%
  element body radius/1.8cm,element body height/4cm,
  element axial thickness/2mm,element position/0.58 from apex,
  element projection ratio/0.24,element axial label/dx,
  element formula label/dV = pi r(x) squared dx}
\tikzphysics@registerkeydefaults{physicssheetelementdiagram}{%
  element body width/5cm,element body height/3cm,
  element width/8mm,element height/6mm,
  element position/0.58,element transverse position/0.58,
  element formula label/dA = dx dy}

\tikzset{
  physics element inner radius/.value required,
  physics element outer radius/.value required,
  physics element radial thickness/.value required,
  physics element start angle/.value required,
  physics element delta angle/.value required,
  physics element dimension offset/.value required,
  physics element diagram gap/.value required,
  physics element body radius/.value required,
  physics element center dot radius/.value required,
  physics element width/.value required,
  physics element height/.value required,
  physics element body width/.value required,
  physics element body height/.value required,
  physics element axial thickness/.value required,
  physics element position/.value required,
  physics element transverse position/.value required,
  physics element projection ratio/.value required,
  physics element radius label/.value required,
  physics element radial label/.value required,
  physics element angular label/.value required,
  physics element arc label/.value required,
  physics element circumference label/.value required,
  physics element width label/.value required,
  physics element height label/.value required,
  physics element axial label/.value required,
  physics element body radius label/.value required,
  physics element cavity radius label/.value required,
  physics element formula label/.value required,
  physics element source/.value required,
}

\makeatother
\endinput
%% End of file `tikzlibrarytikzphysics.elements.code.tex'.
