0

I'm working with tkz-euclide and I'm having a problem with the corners of each inscribed triangle sticking out of the circumference of the circle. This is what it looks like: Uh oh!

... and this is the code I used:

\documentclass[convert]{standalone}
\usepackage{tkz-euclide}

\begin{document} \begin{tikzpicture} \tkzDefPoints{0/0/O, 3/0/P, 3/0/R} \tkzDrawCircle(O,P) \tkzDrawPoint(O) \tkzLabelPoints(O)

\foreach \i in {0,...,2} { \tkzDefPointOnCircle[angle=120\i ,center=O,radius=3] \tkzGetPoint{P} \tkzDefPointOnCircle[angle=120\i + 120,center=O,radius=3] \tkzGetPoint{R} \tkzDrawPolygonfill=blue!20!white }

\end{tikzpicture} \end{document}

I understand this is only a small bit of detail, but I would like to know how I can fix this in case other people have this problem too. Thanks in advance!

Kookie
  • 366
  • 2
  • 11

2 Answers2

4

This question is probable a duplicate. You can change the line join to a type that is more suitable - see: In TikZ when is "line join=miter" the preferrable over "line join=round"?

\documentclass[convert]{standalone}
\usepackage{tkz-euclide}

\begin{document} \begin{tikzpicture} \tkzDefPoints{0/0/O, 3/0/P, 3/0/R} \tkzDrawCircle(O,P) \tkzDrawPoint(O) \tkzLabelPoints(O)

\foreach \i in {0,...,2} { \tkzDefPointOnCircle[angle=120\i ,center=O,radius=3] \tkzGetPoint{P} \tkzDefPointOnCircle[angle=120\i + 120,center=O,radius=3] \tkzGetPoint{R} \tkzDrawPolygonfill=blue!20!white, line join=round }

\end{tikzpicture} \end{document}

Circle and triangle with Better line loints

3

You should adapt the join type:

\documentclass[convert]{standalone}
\usepackage{tkz-euclide}

\begin{document} \begin{tikzpicture} \tkzDefPoints{0/0/O, 3/0/P, 3/0/R} \tkzDrawCircle(O,P) \tkzDrawPoint(O) \tkzLabelPoints(O)

    \foreach \i in {0,...,2}
    {
        \tkzDefPointOnCircle[angle=120*\i ,center=O,radius=3]
        \tkzGetPoint{P}
        \tkzDefPointOnCircle[angle=120*\i + 120,center=O,radius=3]
        \tkzGetPoint{R}
        \tkzDrawPolygon[fill=blue!20!white,line join=bevel](O,P,R)
    }

\end{tikzpicture}

\end{document}

Michel Janssens
  • 306
  • 1
  • 6