5

When I use the tkz arrow option to \tkzDrawArc twice, the first arrowhead gets doubled.

\documentclass{standalone}
\usepackage{tkz-euclide}
\begin{document}

\begin{tikzpicture} \draw (-3,-1) rectangle (3,3); \tkzDefPoints{0/0/O,2/0/R,-2/0/L} \tkzDrawArctkz arrow={stealth[scale=1.5] at .25}, tkz arrow={stealth[scale=1.5] at .75}(L) \tkzDrawSegmenttkz arrow={stealth[scale=1.5] at .25}, tkz arrow={stealth[scale=1.5] at .75}

\end{tikzpicture}

I add that the reason I am not using tkz arrows is because it doesn't appear to be configurable, and arrowheads are too big.

enter image description here

  • Personally I prefer to modify the styles outside the plots because TikZ and tkz-euclide` allow it. I find the code more readable. – Alain Matthes Apr 19 '22 at 05:56

3 Answers3

7

Arrows in tkz-euclide it is the decoration part. The main goal is the construction of geometrical figures. In this decoration part, TikZ takes a preponderant place and it is necessary to use more often the options of TikZ. The problem here is that `tkz arrows is proposed to place an arrow on each segment of a path.

So in some cases you have to go through TikZ and know a lot of its options.

The path to represent a circle is composed of four quadrants and tkz arrows allows to place 4 arrows on each quadrant here for a half circle you can expect 2 arrows.

\documentclass{standalone} 
\usepackage{tkz-euclide}

\tikzset{tkz arrows/.style= {postaction={on each path={tkz arrow={Stealth[scale=1,black]}}}}}

\begin{document}

\begin{tikzpicture} \tkzDefPoints{0/0/A, 3/0/B, -3/0/C} \tkzDrawSemiCircletkz arrows,thin \end{tikzpicture} \end{document}

I have kept scale=1 here for the following explanation. In TikZ, some objects have their size depending on the thickness of the line. You must have the same thickness here for arcs, circles etc.

I have added thin. I have to modify the tkz-euclide.cfg file because I left different thicknesses for some objects.

\documentclass{standalone} 
\usepackage{tkz-euclide}
\tikzset{tkz arrows/.style= 
 {postaction={on each path={tkz arrow={Stealth[scale=1,black]}}}}}

\begin{document}

\begin{tikzpicture} \tkzDefPoints{0/0/A, 3/0/B, -3/0/C} \tkzDrawSemiCircletkz arrows,thin \tkzDrawSegments[tkz arrows,thin](C,A A,B) \end{tikzpicture} \end{document}

It is also possible to place a single arrow with tkz arrow on each segment

\documentclass{standalone} 
\usepackage{tkz-euclide}
\tikzset{tkz arrows/.style= 
 {postaction={on each path={tkz arrow={Stealth[scale=1,black]}}}}}

\begin{document}

\begin{tikzpicture} \tkzDefPoints{0/0/A, 3/0/B, -3/0/C} \tkzDrawSemiCircletkz arrows,thin \tkzDrawSegments[tkz arrow={Stealth[scale=1]},thin](C,A A,B) \end{tikzpicture} \end{document}

enter image description here

Alain Matthes
  • 95,075
4

Try the following:

\documentclass[margin=3mm]{standalone}
\usepackage{tkz-euclide}
\tikzset{tkz arrows/.style= 
    {semithick, black,
     postaction={on each path={tkz arrow={Stealth[scale=1.5,black]}}}}
        }
\begin{document}
\begin{tikzpicture}
\tkzDefPoints{0/0/A, 3/0/B, -3/0/C} 
     \tkzDrawArc[tkz arrows](A,B)(C) 
\tkzDrawSegments[tkz arrows](C,A A,B)
\end{tikzpicture}
\end{document}

enter image description here

Zarko
  • 296,517
  • Yes it is a good solution – Alain Matthes Apr 19 '22 at 05:45
  • No need to load TikZ and its library because tkz-euclide does it – Alain Matthes Apr 19 '22 at 05:52
  • @AlainMatthesm thank you very much for this information. Actually I'm novice at using this attractive package. – Zarko Apr 19 '22 at 06:10
  • @AlainMatthes, now I see, after reading your answer (+1), that was to much follow to OP MWE and to less investigate package investigation. I wasn't aware for \tkzDrawSemiCircle. I stil wonder why the first point shouldn't be negative. I need to read documentation again and again ... – Zarko Apr 19 '22 at 07:30
4

Just for comparison, here is a pure TikZ version.

enter image description here

\documentclass{article}

\usepackage{tikz} \usetikzlibrary{decorations.markings,arrows.meta}

\begin{document}

\begin{tikzpicture} \draw[decoration={markings, mark=between positions .19 and 1 step 0.25 with {\arrow{Stealth}}}, postaction=decorate] (2,0) arc (0:180:2) -- cycle; \end{tikzpicture}

\end{document}

To make adjustments to the arrow you can use Stealth[<options>], where <options> can include length=, width=, inset=, among other things (e.g., colors). arrows.meta has many other arrow options as well.

Sandy G
  • 42,558
  • I agree that it is easy with TikZ in this case but if the half circle is not at the origin and the segment is not horizontal it might be a bit more difficult. – Alain Matthes Apr 19 '22 at 05:43
  • @AlainMatthes: I suppose that's true. Though you could just rotate around any point by any angle. – Sandy G Apr 19 '22 at 16:51
  • yes it's the method but I prefer to write DrawSemiCircle(O,A) than to go and find the necessary angles to draw an arc. However, I have to do this to write the macros of the package! – Alain Matthes Apr 19 '22 at 17:28