1

I have three fixed points through which I have constructed an arc which I have closed with a segment. While one end is well joined, the other one has the end of the segment sticking out. Does anyone have any suggestions?

\documentclass[10pt]{article}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}[line cap=round, scale=2.5]
\tkzDefPoint(2.687709573031439,6.723599641337466){A}
\tkzDefPoint(3.482076594620169,7.39830324031115){B}
\tkzDefPoint(4.2961211542514635,6.723599641337466){C}
\tkzCircumCenter(A,B,C)\tkzGetPoint{O}
\tkzDrawArc[line width=1pt,color=black](O,C)(A)
\tkzDrawSegment[line width=1pt](A,C)
\end{tikzpicture}
\end{document}

enter image description here

Qrrbrbirlbel
  • 119,821
igm2103
  • 105

1 Answers1

1

It seems the problem was resolved while I was working on this, but it might be of interest. The basic idea was to combine the segment and arc into one path and end with -- cycle;. The problem is dealing with TikZ arc arguments. Also, cycle didn't help.

\documentclass[10pt]{article}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}[line cap=round, scale=2.5]
\tkzDefPoint(2.687709573031439,6.723599641337466){A}
\tkzDefPoint(3.482076594620169,7.39830324031115){B}
\tkzDefPoint(4.2961211542514635,6.723599641337466){C}
\tkzCircumCenter(A,B,C)\tkzGetPoint{O}
%\path (A) node{A} (B) node{B} (C) node{C} (O) node{O};
\path (A);\pgfgetlastxy{\Ax}{\Ay}
\path (C);\pgfgetlastxy{\Cx}{\Cy}
\path (O);\pgfgetlastxy{\Ox}{\Oy}
\pgfmathsetmacro{\angleA}{atan2(\Ay-\Oy, \Ax-\Ox)}
\pgfmathsetmacro{\angleC}{atan2(\Cy-\Oy, \Cx-\Ox)}
\pgfmathsetmacro{\rx}{(\Ax-\Ox)/2.5cm}% veclen undefined
\pgfmathsetmacro{\ry}{(\Ay-\Oy)/2.5cm}
\pgfmathsetmacro{\radius}{sqrt(\rx*\rx+\ry*\ry)}
\draw[line width=1pt] (A) -- (C) arc[start angle=\angleC, end angle=\angleA, radius=\radius] -- (C);
%\node[below] at (current bounding box.south) {\angleA, \angleC, \radius};
\end{tikzpicture}
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • What it's interesting is that you (obviously) used the same method used by tkz-euclide to compute the arc. Then it's usable with cycle, which is not only with tkz-euclide, I think. – SebGlav Jul 21 '23 at 14:58
  • 1
    @SebGlav - Actually, tikz-euclide may have used the more robust \pgfpatharctoprecomputed, but I don;t know how to combine pgf graphics primatives into a tikz path. – John Kormylo Jul 21 '23 at 18:29