Tikz Illustration for Triangle Inequality

I thought the code would be easy, but it turned out that I spent one hour and half to draw this figure.

triangle inequality

\coordinate (A) at (0,0);
\coordinate (B) at (\sideC,0);
\draw[<->,>=stealth,myred] (A) -- ++ (-\sideA, 0) node [pos=0.5,below] {$\color{myred}{a}$};
\draw[<->,>=stealth,mygreen] (B) -- ++ (\sideB, 0) node [pos=0.5,below] {$\color{mygreen}{b}$};
\draw[<->,>=stealth,myblue] (A) --  (B) node [pos = 0.5, below]{$\color{myblue}{c}$};
\draw[dashed,myred] (A) circle (\sideA);
\draw[dashed,mygreen] (B) circle (\sideB);
\caption{triangle inequality ${\color{myred}{a}} + {\color{mygreen}{b}} >
  {\color{myblue}{c}}$ with $\color{myred}{a = \sideA}$,
  $\color{mygreen}{b = \sideB}$, $\color{myblue}{c = \sideC}$}

The colors are customized for the Discord bot TeXit.

I’ve forgotten how to prove this with elementary tools without using the Cosine Law, which I provided an interactive proof without words on Geogebra.

After writing this article, I learnt how to include caption into standalone from this TeX.SE answer. The line \captionsetup{labelformat=empty} removes “Figure 1: " from the caption.


No comment

Your email address will not be published. Required fields are marked *.