TransWikia.com

Modifications for labeling a triangle

TeX - LaTeX Asked by user60254 on August 2, 2021

I have a diagram that needs some modifications. The mark for the right angle and the label of $theta$ are not in the right places. The arc indicating $angle ACB$ is not in the place. The lengths $x$ and $y$ for $overline{PC}$ and $overline{PB}$, respectively, are not in the right places. The line indicating the length of $overline{BC}$ is shifted rightward from its correct position.

I would like $a + x$ to be typeset in the same direction as the line.

documentclass[10pt]{amsart}
usepackage{tikz}
usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
usepackage{tkz-euclide}
usetkzobj{all}

begin{document}

begin{tikzpicture}
path (60:2.5) coordinate (A) (10:6) coordinate (B) (0:0) coordinate (C);
draw (A)
-- (B) node [at start, above left]{$A$} node [midway, above]{$c$}
-- (C) node [at start, right]{$B$}
-- (A) node [at start, below]{$C$} node [midway, left]{$b$} -- cycle;
coordinate (P) at ($(B)!(A)!(C)$);
draw [dashed] (A) -- (P) node [below]{$P$} node [midway, right]{$h$} -- (C);
C -- node [midway, below]{$x$} -- P -- node [midway, below]{$y$} B;
draw pic[draw, angle radius=2mm,"$theta$",angle eccentricity=2] {angle = B--C--A};
tkzMarkRightAngle(A,P,B);
draw[|<->|] ($(B)!7mm!90:(C)$)--node[fill=white] {$x + y$} ($(C)!7mm!-90:(B)$);
end{tikzpicture}

end{document}

One Answer

Try this:

documentclass[10pt]{amsart}
usepackage{tikz}
usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
usepackage{tkz-euclide}

begin{document}

begin{tikzpicture}
path (60:2.5) coordinate (A) (10:6) coordinate (B) (0:0) coordinate (C);
draw (A)
-- (B) node [at start, above]{$A$} node [midway, above]{$c$}
-- (C) node [at start, right]{$B$}
-- (A) node [at start, left]{$C$} node [midway, left]{$b$} -- cycle;
coordinate (P) at ($(B)!(A)!(C)$);
draw [dashed] (A) --node [midway, right]{$h$}(P)node [below]{$P$}-- (C);
draw (C) -- node [midway, below]{$x$}(P) -- node [midway, below]{$y$} (B);
draw pic[draw, angle radius=5mm,"$theta$",angle eccentricity=1.5] {angle = B--C--A};
tkzMarkRightAngle(A,P,B);
draw[|<->|] ($(B)!7mm!90:(C)$)--node[fill=white,sloped] {$x + y$} ($(C)!7mm!-90:(B)$);
end{tikzpicture}

end{document}

The output now:

enter image description here

Correct answer by AboAmmar on August 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP