修复旧的 tkz-2d TIKZ 示例

修复旧的 tkz-2d TIKZ 示例

我想要使​​用以下 TikZ 示例:

TikZ 示例 相交圆弧

但是,该软件包tkz-2d已被 取代tkz-euclide。它会产生大量错误,并且输出是一个小点。下载旧版本的 tkz-2d 也无济于事,因为它会产生更多错误。

\documentclass{article}

\usepackage{tikz, tkz-euclide}

\usepackage[graphics,tightpage,active]{preview}
\setlength{\PreviewBorder}{3pt}
\PreviewEnvironment{tikzpicture}
\begin{document}

\begin{tikzpicture}
  % Initialize tkz-2d and set the range of x and y values
  \tkzInit[xmin=-4.1,xmax=5.2,ymin=-4.1,ymax=8]
  \tkzClip

  % Define two points using TikZ. Note TikZ coordinates can be given
  % in polar form.
  \coordinate (A) at (100:8);
  \coordinate (B) at (50:8);

  % Draw a circle. Note star form of \tkzPoint defines points but does
  % not draw them.
  \tkzPoint*(0,0){C} % center of circle
  \tkzPoint*(0,4){R} % radius of circle
  \tkzCircle(C,R)

  % Define the points that are tangent to the circle where the tangent
  % line passes through either A or B
  \tkzTgtFromP(C,C,R)(A){D}{E}
  \tkzTgtFromP(C,C,R)(B){F}{G}

  % Compute the distance between A and D (the result is stored in
  % \tkzmathLen)
  \tkzMathLength(A,D)

  % Fill and highlight the sector centered at A
  \tkzFillSector*[color=blue!80!black,opacity=0.5](A,\tkzmathLen pt)(D,E)
  \tkzArc*(A,A,D)(D,E)

  % Fill and highlight the sector centered at B
  \tkzMathLength(B,F)
  \tkzFillSector*[color=red!80!black,opacity=0.5](B,\tkzmathLen pt)(F,G)
  \tkzArc*(B,B,F)(F,G)

  % Find the intersection of the two arcs  
  \tkzInterCC(A,A,D)(B,B,F){H}{I}

  % Draw the intersection
  \tkzDrawPoint[pos=below left](I)
\end{tikzpicture}

\end{document}

有人可以帮忙让它工作吗?

答案1

Ignasi 给出了正确答案:手册第 112 页tkz-euclide。请务必将其添加\usetkzobj{all}到页眉中!

相关内容