1

I was implementing the following codes (based on tkz-euclide) to generate a figure. The weird thing happens when I define and plot the point E. E is (defined as) the intersection of line AB and line CD. However, it always shows up as an intersection of line CD and circle OA (as shown below). I carefully checked the syntax and it seems ok to me. I was thus left wondering where the bug is. Any help is appreciated!

enter image description here

\documentclass[dvipsnames]{article}

\usepackage{tkz-euclide,tikz}
\begin{document}
 \begin{tikzpicture}[scale=0.5]
    \tkzDefPoints{0/0/A,8/0/B,6/5/C}
    \tkzDrawPoints(A,B,C)
    \tkzLabelPoints[above right](C)
    \tkzLabelPoints[below left](A)
    \tkzLabelPoints[below right](B)
    \tkzDrawPolygon[thick](A,B,C)
    \tkzDefCircle[circum](A,B,C)
\tkzGetPoint{O}
\tkzDrawCircle[thick, color=black](O,A)
  \tkzDefPointBy[rotation in rad= center C angle pi/10](A)
  \tkzGetPoint{Y}
  \tkzInterLC(C,Y)(O,A)
  \tkzGetPoints{Z}{D}
  \tkzDrawSegment[thick, black](C,D)
  \tkzDrawPoints(D)
  \tkzLabelPoints[below left](D)
 \tkzInterLL(C,D)(A,B)
 \tkzGetPoints(E)
 \tkzDrawPoints(E)
\tkzLabelPoints(E)
\end{tikzpicture}


\end{document}
2
  • 1
    The error is at the line with command \tkzGetPoints(E). This command has to be replaced wiyh the command \tkzGetPoint{E} , notice the curly brackets! Then it works fine! See my answer below.
    – miltos
    Commented Jan 7, 2023 at 11:00
  • 1
    @miltos Thanks!
    – OnoL
    Commented Jan 7, 2023 at 17:01

2 Answers 2

2

You don't need to load tikz when you load tkz-euclide because it is required from the last one. Here is the solution, you have to replace the brackets with curly brackets at \tkzGetPoint{E} macro:

\documentclass[dvipsnames]{article}

\usepackage{tkz-euclide}

\begin{document}
    \begin{tikzpicture}[scale=0.5]
        \tkzDefPoints{0/0/A,8/0/B,6/5/C}
        \tkzDrawPoints(A,B,C)
        \tkzLabelPoints[above right](C)
        \tkzLabelPoints[below left](A)
        \tkzLabelPoints[below right](B)
        \tkzDrawPolygon[thick](A,B,C)
        \tkzDefCircle[circum](A,B,C)
        \tkzGetPoint{O}
        \tkzDrawCircle[thick, color=black](O,A)
        \tkzDefPointBy[rotation in rad= center C angle pi/10](A)
        \tkzGetPoint{Y}
        \tkzInterLC(C,Y)(O,A)
        \tkzGetPoints{Z}{D}
        \tkzDrawSegment[thick, black](C,D)
        \tkzDrawPoints(D)
        \tkzLabelPoints[below left](D)
        \tkzInterLL(C,D)(A,B)
        \tkzGetPoint{E}
        \tkzDrawPoints(E)
        \tkzLabelPoints(E)
    \end{tikzpicture}
    
    
\end{document}

output

2

I prefer this presentation. We can notice \tkzDrawPoints(A,...,E) as well as \tkzLabelPoints[below left](A,D,E)

\documentclass[dvipsnames]{article}
\usepackage{tkz-euclide}

\begin{document}
    \begin{tikzpicture}[scale=0.5]
      % fixed points
        \tkzDefPoints{0/0/A,8/0/B,6/5/C}
      % calculated points
        \tkzDefCircle[circum](A,B,C)  
        \tkzGetPoint{O}
        \tkzDefPointBy[rotation in rad= center C angle pi/10](A)
        \tkzGetPoint{Y}
        \tkzInterLC(C,Y)(O,A) 
        \tkzGetPoints{Z}{D}
        \tkzInterLL(C,D)(A,B) 
        \tkzGetPoint{E}
      % drawings
        \tkzDrawCircle[thick, color=black](O,A)
        \tkzDrawPolygon[thick](A,B,C)
        \tkzDrawSegment[thick, black](C,D)
        \tkzDrawPoints(A,...,E)
      % labels
        \tkzLabelPoints[below left](A,D,E)
        \tkzLabelPoints[below right](B)
        \tkzLabelPoints[above right](C)
    \end{tikzpicture}    
\end{document}
4
  • 1
    Very clean presentation. Very helpful. Thanks!
    – miltos
    Commented Jan 7, 2023 at 21:22
  • 1
    @miltos I'm glad if it helps. I'm finishing the use of lua in tkz-euclide so it's interesting to separate the calculations and the drawings. Commented Jan 8, 2023 at 14:04
  • @Allen Matthes: Waiting for it! It will be at the next update of tkz-euclide?
    – miltos
    Commented Jan 8, 2023 at 19:03
  • 1
    @miltos yes we will have access to the old version 4.25 and with an option "lua" a majority of functions rewritten with lua. Commented Jan 8, 2023 at 21:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .