# Drawing a triangle

I want to draw a triangle (with the package TikZ). I don't know how to draw the line, which links the BC points. I know I have to use these commands: +(a,b), ++(a,b), (a:b|-c,d). Unfortunately I cannot use any of these commands, so please explain, how to use these commands and what do they mean.

Please, introduce the commands in detail. And also, I need the line, which links the points AB. I do not need the points and the "=45°" in my LaTeX document.

• Here you can find a very good user guide with facilities. ctan.org/pkg/tkz-euclide See Sections 14.2.1 triangle de Pythagore and 14.12.1 Colorier un polygone. May 11, 2015 at 17:14
• I'm assuming that @Sigur knows you can read French...
– cfr
May 11, 2015 at 20:24
• @cfr, I don't, know. But I informed the section number. It is easy to see the code. May 12, 2015 at 4:56
• Why isn't the answer accepted? Jun 5, 2020 at 16:10
• What is given to this construction? alpha, gamma (?) and (?)... ?
– cis
Oct 1, 2020 at 12:38

I probably do not know tikz more than you (being a MetaPost user), but out of curiosity I've just consulted the quite elegant tutorial at the beginning its documentation (p. 28-93), and I've come to this result:

\documentclass[12pt, border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[anchor=north]{$A$}
-- (4,0) node[anchor=north]{$C$}
-- (4,4) node[anchor=south]{$B$}
-- cycle;
\end{tikzpicture}
\end{document}


After five years ...

• For starting point is used @Franck Pastor nice answer (+1)
• instead nodes are employed coordinates with labels
• added is angle value (using siunitx)
\documentclass[12pt, tikz, border=5mm]{standalone}
\usetikzlibrary{angles,
quotes}
\usepackage{siunitx}

\begin{document}
\begin{tikzpicture}[
my angle/.style = {draw, fill=teal!30,
angle eccentricity=1.1,
right, inner sep=1pt,
font=\footnotesize}
]
\draw   (0,0) coordinate[label=below:$A$] (a) --
(4,0) coordinate[label=below:$C$] (c) --
(4,4) coordinate[label=above:$B$] (b) -- cycle;
\pic[my angle, "$\alpha=\SI{45}{\degree}$"] {angle = c--a--b};
\end{tikzpicture}
\end{document}


• Hey how do you size those lines? Are them in cm or inches? Oct 1, 2020 at 4:16
• @SebastianLazalde, default units at drawing are cm. If you like to use other units, than you need to declare them explicitly, for example: \draw (0pt,opt) -- (111pt,222pt); Oct 1, 2020 at 6:24