Consider the following code:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections, calc}
\begin{document}
\begin{tikzpicture}[auto]
\draw (0,0) node[below] {$P$} -- (2,0) node[below] {$Q$};
\path[name path=circ] (3,4) node[above] {$O$} circle (3.5);
\path[name path=l1] (0,0) -- (0, 4);
\path[name path=l2] (2,0) -- (2,4);
\path[name intersections={of=l1 and circ, by=a}];
\path[name intersections={of=l2 and circ, by=b}];
\draw (0,0) -- (a) node[above] {$R$};
\draw (2,0) -- (b) node[above] {$X$};
\draw[densely dotted] (3,4) -- (3,0) node[right] {$Z$} -- (2,0);
\draw[densely dotted] (b) -- (b -| 3,0) node[right] {$Y$} (a) -- (a -| 3,0) node[right] {$S$};
\draw[densely dotted] (a) -- (3,4) -- (b);
\draw[|<->|] (-0.1, 0) -- node {$H$} ($ (a) +(-.1,0) $);
\draw[|<->|] (2.1,0) -- node[swap] {$h$} ($ (b) +(.1,0) $);
\draw[|<->|] (0, .1) --node {$d$} (2,.1);
\end{tikzpicture}
\end{document}
What I want to do is, to draw an arc where two endpoints are R and X, and the center of the arc is O. How can I do this by not manually calculating the angle of the two lines OR and OX?
Best Answer
You can use the
angles
-library of tikz.Add
angles
to your\usetikzlibrary
Add at the end of your code:
The points R and X are already defined by the two intersection points
a
andb
. You just need to add acoordinate
at your point O to let tikz do the work.