I want to draw this shape by tex-ive 2015, bout I don't know.
Thank you.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIf you follow the guidelines given in Draw height in Tikz triangle as suggested by @Torbjørn T., you can produce a code more or less like this.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{shadows}
\usetikzlibrary{intersections}
\usetikzlibrary{angles}
\usetikzlibrary{quotes}
\begin{document}
\begin{tikzpicture}
% Definition of the right angle
\def\aeMarkRightAngle[size=#1](#2,#3,#4){%%
\draw ($(#3)!#1!(#2)$) --
($($(#3)!#1!(#2)$)!#1!90:(#2)$) --
($(#3)!#1!(#4)$);}
% Placing the coordinates
\coordinate [label=left:$A$] (A) at (-4, -2);
\coordinate [label=above:$B$] (B) at (0, 4);
\coordinate [label=right:$C$] (C) at (4, -2);
% Drawing the heights
\draw [name path=line 1,dashed] (C) -- ($(A)!(C)!(B)$) coordinate[label=left:$D$,name=D];
\draw [name path=line 2,dashed] (A) -- ($(B)!(A)!(C)$) coordinate[label=right:$E$,name=E];
% Drawing the baricenter
\path [name intersections={of=line 1 and line 2,by=H}];
\node [fill=black,inner sep=1pt,label=90:$H$] at (H) {};
% Drawing the sides
\draw (A) -- node[sloped,above]{$c-a$} (D) -- node[sloped,above]{$a$}(B);
\draw (B) -- node[sloped,above]{$a$} (E) -- node[sloped,above]{$c-a$}(C);
\draw (C) -- (A);
% Drawing angles
\pic [draw, -, "$\theta$", angle eccentricity=1.5] {angle = A--B--C};
\pic [draw, -, "$\pi-\theta$", angle eccentricity=1.5] {angle = A--H--C};
\aeMarkRightAngle[size=6pt](C,D,B)
\aeMarkRightAngle[size=6pt](B,E,A)
% Adding last labels
\path (A) -- node[sloped,above]{$b-h$} (H);
\path (C) -- node[sloped,above]{$b-h$} (H);
\path (D) -- node[sloped,above]{$h$} (H);
\path (E) -- node[sloped,above]{$h$} (H);
\end{tikzpicture}
\end{document}
Here's an example with tkz-euclide
, take some time to read the manual, it has lots of features. Also see the manual for Tikz/PGF
, very useful since tkz-euclide
is based on it. Please make sure you post at least something you've tried next time, even just to provide some information about the graphic you're drawing (for example in this case, I assymed you wanted an equilateral triangle, but you didn't specify that).
\documentclass[margin=10pt]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
% Get points for equilateral triangle and draw it
\tkzDefPoints{0/0/A, 8/0/C}
\tkzDefEquilateral(A,C)\tkzGetPoint{B}
\tkzDrawPolygon(A,B,C)
% perpendicular heights + intersection to find point H
\tkzDrawAltitude[dashed](B,C)(A) \tkzGetPoint{E}
\tkzDrawAltitude[dashed](A,B)(C) \tkzGetPoint{D}
\tkzInterLL(A,E)(C,D) \tkzGetPoint{H} \tkzDrawPoint[fill=black](H)
% Segment labels
\tkzLabelSegments[above,midway,sloped](A,D E,C){$c-a$}
\tkzLabelSegments[above,midway,sloped](D,B B,E){$a$}
\tkzLabelSegments[above,midway,sloped](A,H H,C){$b-h$}
\tkzLabelSegments[above,midway,sloped](D,H H,E){$h$}
% Angles and labels
\tkzMarkAngle[size=5mm](A,B,C) \tkzLabelAngle[pos=.7](A,B,C){$\theta$}
\tkzMarkAngle[size=5mm](A,H,C) \tkzLabelAngle[pos=.7](A,H,C){$\pi-\theta$}
\tkzMarkRightAngle(C,D,B)
\tkzMarkRightAngle(A,E,B)
% Point labels
\tkzLabelPoints[above](B,H)
\tkzLabelPoints[right](E,C)
\tkzLabelPoints[left](A,D)
\end{tikzpicture}
\end{document}