\documentclass[convert = false, border = 1cm, tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) circle[radius = .35cm];
\draw (-60:1.5cm) -- +(0, 4);
\draw (0, 0) -- (-60:1.5cm);
\filldraw[black] (-60:.35cm) circle[radius = .04cm] node[below, font =
\scriptsize] {P};
\draw (-60:1.5cm) -- ++(150:4cm);
\end{tikzpicture}
\end{document}
如何构造具有给定渐近线并过点的双曲线P
?
我们知道,转弯角为度,到直线交点的120
距离为,即半长轴,近拱点半径为。P
1.5cm
.35cm
答案1
我发现绘制然后以适当的角度旋转所有内容更容易。
编辑:如果您希望坐标系的原点与圆心重合,只需平移即可,scope
如下面的代码所示(shift
在之前应用rotate
)。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def\angle{60}
\def\circradius{.35}
\def\a{1.5}
\def\asymlen{4}
\begin{scope}[rotate={\angle/2},shift={(0,{-\a-\circradius})}]
\draw (0,0) -- (0, {\a+\circradius}) circle[radius = \circradius];
\draw ({90-\angle/2}:0) -- ({90-\angle/2}:\asymlen);
\draw ({90+\angle/2}:0) -- ({90+\angle/2}:\asymlen);
\filldraw[black] (0,\a)
circle[radius = .04cm] node[right, font =\scriptsize] {P};
\def\myangle{60}
\pgfmathsetmacro\b{\a/tan(\myangle)}
\draw plot[domain=-2:2,samples=100] ({\x},{\a*sqrt(1+(\x/\b)^2)});
\end{scope}
\fill[red] (0,0) circle[radius = .1cm]; % CS origin
\end{tikzpicture}
\end{document}