%% examples/optics-ray-composition.tex
%%
%% Named, numeric-family, and shorthand surface anchors keep ray paths concise.

\documentclass[tikz, border=6mm]{standalone}
\usepackage{tikzphysics}

\begin{document}
\begin{tikzpicture}[ray/.style={red!75!black, very thick, ->}]
  \node[convex-lens, convex lens radius=3cm,
        convex lens thickness=0.2cm,
        convex lens aperture angle=25] (L) at (0,0) {};
  %% Snell-law exit point and focus for n(lens)/n(air)=1.50.
  \coordinate (Lexit) at ($(L.center)+(0.29194,0.72588)$);
  \coordinate (Lf) at ($(L.center)+(2.93841,0)$);
  \draw[densely dashed, gray] (-3,0) -- (3.3,0);
  \draw[ray] ($(L.80)+(-3,0)$) -- (L.80) -- (Lexit) -- (Lf);

  \node[slab, minimum width=1.2cm, minimum height=3cm]
    (S) at (5.2,0) {};
  \draw[ray] (3.2,-0.8) -- (S.30) -- (S.back-65) -- (7.2,0.8);

  \node[prism, prism width=3cm, prism height=2.6cm]
    (P) at (10.2,0) {};
  \draw[ray] (8.1,-0.4) -- (P.50) -- (P.right-65) -- (12.4,0.8);
\end{tikzpicture}
\end{document}
