# Draw isosceles triangle with angles and stuff in TikZ

\begin{center}
\begin{tikzpicture}

\draw [line width=1pt, fill=yellow!2] (-1,-3.5) -- (9,-3.5) -- (9,3.5) --     (-1,3.5) -- cycle;

\coordinate (A) at (0,0);
\coordinate (B) at (8,-2);
\coordinate (C) at (8,2);

\draw [line width=1.5pt, fill=white] (A) -- (B) -- (C) -- cycle;

\end{tikzpicture}
\end{center}


Ok well, I neeeeeed your help. How do I draw this piece in TikZ?

I tried things with arc but I have no idea how to draw the lines in the triangle. Thanks in advance for your help.

• welcome to tex.se! first you need to resolve geometry problem (determine coordinates positions or all angle sizes). than drawing your image will be easy. what is your problem? – Zarko Dec 14 '17 at 10:19
• well i know the angles, but im new to Latex and tikz and have no clue wich commands to use to draw the inner lines and the radius to the right. – mxstgr Dec 14 '17 at 10:32
• You need to practice writing number 1. – Artificial Stupidity Dec 14 '17 at 10:33
• Well I know but I have to deliver the Assignment till tomorrow so, I have only one day left. 😫 – mxstgr Dec 14 '17 at 10:35
• I provided an answer, focusing only in how to find the points with TikZ. However, if you also want to know how to draw those cute angles, look at the section in the TikZ manual Angle Library. It requires the use of \usetikzlibrary{angles}, and if you are not able to use the Angle library, post that here and I hope either me or someone else can supply you with the resources needed to learn how to use it :) – Alex Recuenco Dec 14 '17 at 11:48

## 3 Answers

pure tikz solution:

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{angles, arrows.meta,
intersections,
quotes}

\begin{document}
\begin{tikzpicture}[
my angle/.style = {draw,very thin, Straight Barb-Straight Barb,
angle radius=5mm,
angle eccentricity=0.75,
font=\footnotesize
} % angle label position!
]
\coordinate[label= left:A] (A);
\coordinate[label=right:B] (B) at ( 7.5:8);
\coordinate[label=right:C] (C) at (-7.5:8);
%
\draw[gray] (10:8) arc (10:-10:8);
%
\draw[name path=b1, line width=1pt] (A) -- (B) -- (C) -- cycle;
\pic [my angle, "$\gamma$"]   {angle = A--B--C};
%
\path[name path=a1] (C) -- + (37.5+90:2.5);
\draw[name intersections={of=a1 and b1, by={B'}}]
(C) -- (B') node[above] {B'};
\pic [my angle, "$\alpha$"]   {angle = C--B'--B};
%
\path[name path=a2] (B') -- + (7.5+240:2);
\draw[name intersections={of=a2 and b1, by={notused,C'}}]
(B') -- (C') node[below] {C'};;
\pic [my angle, "$\alpha$"] {angle = C'--B'--C};
%
\path[name path=a3] (C') -- + (7.5+90:2);
\draw[name intersections={of=a3 and b1, by={B''}}]
(C') -- (B'') node[above] {B''};
\pic [my angle, "$\alpha$"] {angle = B''--B'--C'};
\pic [my angle, "$\cdot$"]  {angle = A--B''--C'};
\pic [my angle, "$\beta$"]  {angle = C--C'--B'};
\pic [my angle, "$\beta$"]  {angle = B''--C'--A};
\end{tikzpicture}
\end{document}


• Wonderful. I always thought you were very good at using LaTeX. I upvote your old question. – Sebastiano Apr 1 '18 at 21:48

I am not going to use the angles and distances of your problem myself, since this is a homework problem (Although you say you have found them already :P)

However, I will give you the tools that you should be looking at to try to find all those points. You are still going to need to find some properties about those points yourself to be able to write them.

But once you have those properties between them. The distance between two points, the angle between the lines and so on, hopefully the following methodology helps you find the points within TikZ.

We are going to use the following libraries:

\usetikzlibrary{calc}
\usetikzlibrary{intersections, through}


## Proportions:

If you already know the distance between two points and a intermediate point. Let's say, for example, that a point is 1cm away from A in the direction from A to B, you write

\coordinate (D) at ($(A)!1cm!(C)$);


If, on the other hand, you know that the point is 30% from A and 70% from C in the line that joins them, you write instead

\coordinate (D) at ($(A)!.3!(C)$);


## Projections

If you know that point E is the projection of the point D along the line AB, you can find that projection by writing:

\coordinate (E) at ($(A)!(D)!(B)$);


(This implies that the lines DE and AB are orthogonal)

## Points in the other line at an angle

To find a point in another line that is at a given angle from a line, this requires 3 steps. Finding a point in a line at that angle, draw both lines, find the intersection:

1. Finding a point at an angle: Let's say we call that point F.

If I want to find a point that is at a 30 degree angle from the line DE, I can find it by writing:

\coordinate (F) at ($(D)!3!-30:(E)$);


Notice how angles are counted counter-clockwise, notice as well that D is fixed while E is "turned" to find F. I chose "3" times the distance, since I will find the intersection of this line with the line AB later, and I don't know how far away that intersection is.

2. Draw both lines:

After finding that point F, we need to draw both lines and save them. We do so by using the name path option:

    \draw [name path=DF] (D) -- (F);
\draw [name path=AB] (A) -- (B);
% Use \path if you don't want to draw them

3. Find the intersection:

We will call the intersection by the letter G. Inside a \path you just need to use the name intersections tag as follows:

    \path[name intersections={of= DF and AB, by = G}];


# Example

Therefore, this is my suggestion that I include in how you should go about it.

There are other ways that could make it faster... but I think those 3 rules above are easy enough for a beginner.

I took the liberty of, instead of hardcoding some of the angles, writing a \pgfmathsetmacro{\cmd}{mathsy stuff}, so that you can "code it" before you know all the angles.

\documentclass{article}
\usepackage{tikz}
\usepackage[utf8]{inputenc}
\usetikzlibrary{calc}
\usetikzlibrary{intersections, through}

\begin{document}
\begin{tikzpicture}

\draw [line width=1pt, fill=yellow!2] (-1,-3.5) -- (9,-3.5) -- (9,3.5) --     (-1,3.5) -- cycle;

\pgfmathsetmacro{\angle}{30}
\pgfmathsetmacro{\anglealpha}{60}
\pgfmathsetmacro{\anglebeta}{30}
\pgfmathsetmacro{\proportion}{.3}
\coordinate (A) at (0,0);
\coordinate (B) at (\angle/2:8); %
\coordinate (C) at (-\angle/2:8);
\coordinate (D) at ($(A)!\proportion!(C)$); % Point between A and C
\coordinate (E) at ($(A)!(D)!(B)$); % Projection
\coordinate (F) at ($(D)!3!-30:(E)$); % Point in a line 30 degrees from DE (D is fixed and rotated around E to get the new line)

\draw [name path=DF] (D) -- (F);
\draw [name path=AB] (A) -- (B);
\path[name intersections={of= DF and AB, by = G}]; %Finding intersection

\coordinate (H) at ($(G)!3!\anglealpha:(D)$); % We would continue this way
\draw[name path = HG] (H) -- (G);
%... you keep going

%Code to draw all the letters automatically
\foreach \name in {A, ..., H}{
\fill (\name) circle (2pt) node[above]{\name};
}

\draw [line width=1.5pt, fill=none] (A) -- (B) -- (C) -- cycle;

\end{tikzpicture}
\end{document}


• Thats awesome. Thanks a lot. I have updated my sketch with your Information. but I still have 2 little questions, I described them down there: – mxstgr Dec 14 '17 at 12:56
• how to make the circle piece: Since I see you are already using the tkz-euclide library, to draw the arc that extends further, use \tkzDrawArc[delta=10](A,C)(B);. (Remember to load all objects with \usetkzobj{all} in the preamble) – Alex Recuenco Dec 14 '17 at 13:10
• To change the size of labels: have you tried changing the font with \small or \tiny or whichever size you need? – Alex Recuenco Dec 14 '17 at 13:12
• Thanks a lot, my two questions, answered above are: how to make the circle piece to the right ( in the picture ). And i would like to make the labels smaller? Like the text of the Labels, how do I do that? – mxstgr Dec 14 '17 at 13:18
• the full code is now below to check. thanks man! – mxstgr Dec 14 '17 at 13:28
\documentclass[11pt]{article}

%\usepackage[ngerman]{babel}
%\usepackage[applemac]{inputenc}
%\usepackage{amsmath,color,algorithm2e,algorithmic}
%\usepackage{fancyhdr}
%\usepackage{graphicx}
%\usepackage{pgffor}
\usepackage{tkz-euclide}
\usetkzobj{all}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{through}
\usetikzlibrary{intersections, through}

\usepackage[a4paper, left=2.5cm, right=2.5cm]{geometry}

\begin{document}

\begin{center}
\begin{tikzpicture}

\draw [line width=1pt, fill=yellow!2] (-1,-2.5) -- (9,-2.5) -- (9,2.5) --     (-1,2.5) -- cycle;

\pgfmathsetmacro{\angle}{30}
\pgfmathsetmacro{\anglealpha}{60}
\pgfmathsetmacro{\anglebeta}{75}
\pgfmathsetmacro{\anglegamma}{82.5}

\coordinate (A) at (0,0);
\coordinate (B) at (\angle/4:8);
\coordinate (C) at (-\angle/4:8);

\draw [name path=AB] (A) -- (B);
\draw [name path=AC] (A) -- (C);

\coordinate (D) at ($(C)!3!37.5:(B)$);
\path[name path=CD] (C) -- (D);
\path[name intersections={of= CD and AB, by = F}];
\draw[name path = CF] (C) -- (F);

\coordinate (G) at ($(F)!3!-\anglealpha:(C)$);
\path[name path = FG] (F) -- (G);
\path[name intersections={of= FG and AC, by = H}];
\draw[name path = FH] (F) -- (H);

\coordinate (I) at ($(H)!3!\angle:(F)$);
\path[name path = HI] (H) -- (I);
\path[name intersections={of= HI and AB, by = J}];
\draw[name path = HJ] (H) -- (J);

% Winkel Beta
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](J,H,A)
\tkzLabelAngle[pos = 0.4](J,H,A){\tiny$\beta$}

\tkzMarkAngle[fill= none,size=0.6,opacity=.7](C,H,F)
\tkzLabelAngle[pos = 0.4](C,H,F){\tiny$\beta$}

% Winkel Alpha
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](A,F,H)
\tkzLabelAngle[pos = 0.4](A,F,H){\tiny$\alpha$}

\tkzMarkAngle[fill= none,size=0.6,opacity=.7](H,F,C)
\tkzLabelAngle[pos = 0.4](H,F,C){\tiny$\alpha$}

\tkzMarkAngle[fill= none,size=0.6,opacity=.7](C,F,B)
\tkzLabelAngle[pos = 0.4](C,F,B){\tiny$\alpha$}

% Winkel Gamma
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](A,B,C)
\tkzLabelAngle[pos = 0.4](A,B,C){\tiny$\gamma$}

% Rechter Winkel
\tkzMarkAngle[fill= none,size=0.6,opacity=.7](A,J,H)
\tkzLabelAngle[pos = 0.36](A,J,H){\huge$\cdot$}

\draw [line width=1.5pt, fill=none] (A) -- (B) -- (C) -- cycle;

\tkzDrawArc[delta=8](A,C)(B);

\end{tikzpicture}
\end{center}

\end{document}


Thanks Alex, everything work fine now. Thanks a lot.