2

I'm trying to draw the following picture about Heron's Problem enter image description here

I don't know how to draw angles and dotted lines. Here is my incomplete code.

\documentclass{standalone}

\usepackage[T1]{fontenc}

\usepackage[utf8]{inputenc}

\usepackage{lmodern}

\usepackage{ tikz, }

\usetikzlibrary{ intersections, calc }

\begin{document}

\begin{tikzpicture}[font=\small]

\draw

(0,0) coordinate (A)

(1,1.435) coordinate (B)

(3,3) coordinate (C)

; \draw[thick] (A) rectangle (C);

\draw[thick] (A)--(B) nodepos=0.6, inner sep=0pt, outer sep=0pt{x};

\draw[thick] ($(x)!0.5cm!90:(A)$) -- ($(x)!0.5cm!-90:(A)$);

\end{tikzpicture}

\end{document}

projetmbc
  • 13,315
wessi
  • 292
  • For dots and dashes, see e.g. https://tex.stackexchange.com/questions/327982/draw-a-dash-dotted-line/327983#327983. For angles see e.g. https://tex.stackexchange.com/questions/20826/label-angle-with-tikz/136971#136971 – Torbjørn T. Feb 25 '22 at 13:57
  • (Those apostrophes might look better as ^\prime.) – Andrew Morton Feb 26 '22 at 11:45

3 Answers3

5

It is rather easy to obtain with pstricks, and more specifically with its pst-eucl module:

\documentclass[border=10pt, svgnames]{standalone}
\usepackage{pst-eucl}

\begin{document}

\psset{linejoin=1, unit=1cm, MarkAngleRadius=0.6} \begin{pspicture}(-1,-2.5)(5.5, 2.5) \pstGeonodePointSymbol=none, PosAngle={180,180,-90,90}{A}(0,-2.1){A1}(2.1,0){C}(3.5,1.4){B} \pstGeonodePointSymbol=none, PointName={$A'$,$B'$} ,PosAngle={150,30}{A0}(3.5,0){B0} \psline(-1,0)(5.5,0) \pstRightAngle{A}{A0}{C} \pstMarkAngle{A}{C}{A0}{} \pstMarkAngle{B0}{C}{B}{} \pslinelinewidth=2pt(C)(B) \psset{SegmentSymbol=pstslashh} \pstSegmentMark{A}{A0} \psset{linestyle=dashed} \pstSegmentMark{A0}{A1} \psline(A1)(C)\psline(B)(B0) \end{pspicture}

\end{document}

enter image description here

Bernard
  • 271,350
4
\documentclass[margin=1cm]{standalone}
\usepackage{tkz-euclide}    
\begin{document}
\begin{tikzpicture}
 \tkzDefPoints{0/0/A',0/4/A,5/2/B,5/0/B'}
 \tkzDefPointBy[symmetry=center A'](A) \tkzGetPoint{A_1}
 \tkzInterLL(A_1,B)(A',B') \tkzGetPoint{C}
 \tkzDrawSegments[line width=2pt](A,C C,B)
 \tkzDrawLine(A',B')
 \tkzDrawSegments[dashed](A',A_1 A_1,C B,B')
 \tkzDrawSegment(A,A')
 \tkzLabelPoints[above right](B,B')
  \tkzLabelPoints(C)
 \tkzLabelPoints[above left](A',A_1,A)
 \tkzMarkSegments[mark=s||](A,A' A',A_1)
 \tkzMarkRightAngle(C,A',A)
 \tkzMarkAngles(A,C,A' B',C,B)
\end{tikzpicture}   
\end{document}

enter image description here

Alain Matthes
  • 95,075
3

Try this code:

\documentclass[border=.5cm]{standalone}

\usepackage{tikz}

\def\centerarc#1(#3:#4:#5);% %Syntax: [draw options] (center) (initial angle:final angle:radius) { \draw#1 arc (#3:#4:#5); } \begin{document}

\begin{tikzpicture}[font=\small]
    \draw (0,3) coordinate (A) node[left] () {$A$};
    \draw (3.5,2) coordinate (B) node[above] () {$B$};  
    \draw[very thin] (0,0) rectangle (.2,.2);
    \draw (0,0) node[below left] () {$A'$};
    \draw (0,-3) node[left] () {$A_1$};
    \draw (2.1,0) node[below] () {$C$};
    \draw[thin] (-2,0)--(5,0);
    \draw[blue,thick,pos=.5,-latex] (A)--(2.1,0);
    \draw[dashed] (A)--(0,-3);
    \draw[dashed] (0,-3)--(3.5,2);
    \draw[blue,thick,pos=.5,-latex] (2.1,0)--(3.5,2);
    \centerarc[thick,red](2.1,0)(125:180:.5);
    \centerarc[thick,red](2.1,0)(55:0:.5);
\end{tikzpicture}

\end{document}

Output:

enter image description here