I'd like to draw an optics-related figure, for which I need to draw several beams with varying opening angles, which will need to be labeled.
What I've come up at the moment (boiled down to a minimal example) is below:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usepackage[active,tightpage]{preview}
\begin{document}
\centering
\begin{preview}
\begin{tikzpicture}
\coordinate (origin) at (0,0);
\coordinate (screen-top) at (5,2);
\coordinate (screen-bottom) at (5,-2);
\draw [dashed,name path=beam] (origin) -- (screen-top) -- (screen-bottom) -- cycle;
\draw [green,name path=circle] (0,0) circle (1);
\path [name intersections={of=beam and circle,name=arc}];
\draw [bend left] (arc-1) to node [midway,right] { \(\alpha\)} (arc-2) ;
\end{tikzpicture}
\end{preview}
\end{document}
Now I have a problem with this code. I can't seem to be able to automatically figure out the correct bending angle of the path between the intersections (the creen circle and the beam), so the bend is not 'nice', as seen in the figure below.
I know that I can manually set the bending angle with [bend left=19]
instead of [bend left]
, but doing this manually for all drawings seems like not doing it the TikZ-way.
Does anyone have a tip for automatically calculating the bending angle for the path so it automatically matches a circle going through that point? Automatically means for different beam angles and 'screen' sizes and positions (which can be set in the code...)