I would like to make the following diagram:

How could I make it? I find it difficult create the hyperbola's arc.
I would like to make the following diagram:

How could I make it? I find it difficult create the hyperbola's arc.
Although your picture suggests otherwise, I will assume that the “bow” is in fact an arc of constant radius.
Ignoring the dot and dot* style for a minute (they both place a dot and a label at the coordinate we define later while the latter also draws the dashed lines to the axes), an arc of a constant radius can be drawn very simple using basic geometry, the calc library and the intersection of syntax (that is a wrapper for the intersection cs) to find the center of the radius.
I hope the comments in the code are helpful enough.
I have also added a Bézier curve (?) with the control point C' which is found in the same matter as C (the center of the arc) but lies on the tangent DA.
The coordinate M is found early on with ($(A)!.5!(B)$).
\documentclass[tikz,convert=false]{standalone}
\usetikzlibrary{calc}
\tikzset{
every label/.append style={inner sep=+.1667em},
dot/.style={
label={[
label distance=+0pt,
shape=circle,
fill=black,
inner sep=+0pt,
outer sep=+0pt,
minimum size=+2pt,
label={#1}
]center:}},
dot*/.style={
dot={#1},
append after command={
\pgfextra
\pgfinterruptpath
\let\myTikzlastnode\tikzlastnode
\draw[thin,dashed] (0,0 |- \myTikzlastnode) node[left] {$P_{\myTikzlastnode}$} -| (0,0 -| \myTikzlastnode) node[below] {$Q_{\myTikzlastnode}$};
\endpgfinterruptpath
\endpgfextra
}
}
}
\begin{document}
\begin{tikzpicture}[thick]
\draw[<->] (0,6) node[left] {$P$} |- node[below left] {$O$}
(6,0) node[below] {$Q$};
\path (1,3) coordinate[dot*=below left:$A$] (A)
++(120:1) coordinate[dot =$D$] (D)
(4,1) coordinate[dot*=below left:$B$] (B);
;
\draw let
% let's save D, A and B in other macros so that we can acess their x and y value separately
\p1=(D),
\p2=(A),
\p3=(B),
% then the middle between A and B is
\p{M}=($(\p2)!.5!(\p3)$),
% while the angles from D to A is
\n{1-2}={atan2(\x2-\x1,\y2-\y1)},
% a line orthogonal to the line between A and B has the angle of
\n{ortho 2-3}={90+atan2(\x3-\x2,\y3-\y2)},
% which means that the center of a circle through A and B that has the tangent DA lies at the intersection of
\p{C}=(intersection of A--[shift=(90+\n{1-2}:10)]A and \p{M}--[shift={(\n{ortho 2-3}:10)}]\p{M}),
% the radius is then simply (we can use either A or B to calculate the radius
\n{radius}={veclen(\x{C}-\x3,\y{C}-\y3)},
% the end angle at B is then also
\n{end angle}={atan2(\x3-\x{C},\y3-\y{C})},
%!
%! for the Bézier curve:
\p{C'}=(intersection of A--[shift=(\n{1-2}:10)]A and \p{M}--[shift={(\n{ortho 2-3}+180:10)}]\p{M})
in % great, let's draw it, first the tangent
(D) -- (A)
% then the arc
arc[radius=\n{radius}, start angle=\n{1-2}-90, end angle=\n{end angle}]
% let's append another tangent at the end of the arc
-- ++(\n{end angle}+90:1)
% and while we're at we can also save the center of the arc in a coordiante M
% (\p{C}) coordinate[dot=above:$C$] (C) %?
(\p{M}) coordinate[dot*=above right:$M$] (M)
% let's draw the connection from A to B
(A)--(B)
%!
%! for the Bézier curve
% (\p{C'}) coordinate[dot=left:$C'$] (C') % for later %?
;
%\draw[thin,dotted] (A) -- (C) -- (B) -- (C') -- cycle; %?
%\draw[thin,blue] (A) .. controls (C') .. (B); %?
\end{tikzpicture}
\end{document}

This image is the same as above but shows the center of the radius C, the Bézier curve as well as its control point C' and has been compiled with the lines marked with %? not commented out.
M lying in the middle of A and B.
– Qrrbrbirlbel
Jul 02 '13 at 16:10
See the pgfkeys package documentation for explanation.
Type H
atan2 was changed, see Q244569.
– Qrrbrbirlbel
Jun 09 '16 at 21:02
atan2 in the code.
– Qrrbrbirlbel
Jun 10 '16 at 18:57