I want to draw this shape by tex-ive 2015, bout I don't know. enter image description here

Thank you.


2 Answers 2


If 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.


  % Definition of the right angle
   \draw ($(#3)!#1!(#2)$) -- 
         ($($(#3)!#1!(#2)$)!#1!90:(#2)$) --

  % 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};

  % 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);


The final results is as shown here: Triangle


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).


enter image description here



% Get points for equilateral triangle and draw it
\tkzDefPoints{0/0/A, 8/0/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$}

% Point labels


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .