这是我的代码,
\begin{tikzpicture}
\node (A) at (-4, -3) {A};
\node (o) at (0, 0) {o};
\draw [name path = circle] (o) circle (3.5cm);
\end{tikzpicture}
给定圆外的一个点 A,我想要:
画一条过点 A 的切线到圆上。
找到交点(切线和圆之间)并将该点表示为 B。(我需要稍后使用此点连接到另一个点)。
有办法吗?谢谢。:)
答案1
更新:好的,抱歉误读了您的问题。我想我同意@Zarko 的观点,这几乎与 pgfmanual 中的示例相同。
\documentclass[tikz,border=3.14pt]{standalone}
\usetikzlibrary{intersections,calc}
\begin{document}
\begin{tikzpicture}
\node (A) at (-4, -3) {A};
\node (o) at (0, 0) {o};
\node [circle,draw,name path=circle] (c) at (o) [minimum size=7cm] {};
\draw[red] (A) -- (tangent cs:node=c,point={(A)},solution=1)
coordinate[label=below:B] (B)
(A) -- (tangent cs:node=c,point={(A)},solution=2)
coordinate[label=left:C] (C);
\end{tikzpicture}
\end{document}
\documentclass[tikz,border=3.14pt]{standalone}
\usetikzlibrary{intersections,calc}
\begin{document}
\begin{tikzpicture}
\node (A) at (-4, -3) {A};
\node (o) at (0, 0) {o};
\draw[name path=circle] (o) circle (3.5cm);
\draw[name path=Ao] (A) to[bend left=0](o);
\path [name intersections={of=Ao and circle,total=\t}]
coordinate[label=below:B] (B) at (intersection-1);
\draw ($ (B)!3cm!90:(A) $) -- ($ (B)!3cm!270:(A) $);
\end{tikzpicture}
\end{document}
答案2
下面是使用 进行相同构造的方法pst-eucl
:
\documentclass[11pt, svgnames, border = 5pt]{standalone}
\usepackage{pstricks-add} % loads also pst-node
\usepackage{pst-eucl} % for plane geometry
% \usepackage{auto-pst-pdf} % 使用 pdflatex --enable-write18 (MiKTeX) 或 pdflatex --shell-escape (TX Live, MacTeX) 进行编译
\begin{document}
\begin{pspicture}(-6,-5)(4,4)
\psset{PointSymbol=none, dotsize=2.5pt, linejoin=1, dimen=outer, unit=1cm}
\pstGeonode[PosAngle={30,-150}](0, 0){O}(-4,-3){A}
\pstCircleOA[Radius =\pstDistVal{3.5}, linecolor = IndianRed, linewidth = 1.2pt]{O}{}
\pstMiddleAB[ PointName=none]{O}{A}{I}
\psset{linewidth=0.6pt}
\pstInterCC[RadiusA=\pstDistVal{3.5}, DiameterB=\pstDistAB{O}{A},
CodeFigB=true, CodeFigColor=Gold, PointName=default]{O}{}{I}{}{C}{B}
\uput[l](B){B} \uput[d](C){C}
\psset{linecolor=Tomato, nodesep=-2}
\pstLineAB{A}{B}\pstLineAB{A}{C}
\psline[linestyle=dashed](B)(O)(C)
\psset{linecolor = LightSteelBlue, linewidth=0.4pt, RightAngleSize=0.15}
\pstRightAngle*{A}{B}{O}
\pstRightAngle{A}{C}{O}
\end{pspicture}
\end{document}