Circles in and around a triangle

Here we see how easy it is to define circles tangential or by peripheral points.

  • we define objects
  • then we refere to them
  • we chose an order, so later drawn objects overwrite earlier drawn objects

The code is a follow-up to the Releux triangle recipe.

It is explained in the LaTeX Cookbook, Chapter 10, Advanced Mathematics, Drawing geometry pictures.

Triangle

Edit and compile if you like:
% Circles in and around a triangle
% Author: Stefan Kottwitz
% https://www.packtpub.com/hardware-and-creative/latex-cookbook
\documentclass[border=10pt]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
  \tkzDefPoints{0/0/A, 5/0/B, 1/4/C}
  \tkzDefCircle[in](A,B,C)
  \tkzGetPoint{M}
  \tkzGetLength{r}
  \tkzDefCircle[circum](A,B,C)
  \tkzGetPoint{N}
  \tkzGetLength{R}
  \tkzDefPointBy[projection=onto A--B](M)
  \tkzGetPoint{a}
  \tkzDefPointBy[projection=onto B--C](M)
  \tkzGetPoint{b}
  \tkzDefPointBy[projection=onto A--C](M)
  \tkzGetPoint{c}

  \tkzDrawCircle[R](M,\r pt)
  \tkzDrawCircle[R](N,\R pt)
  \tkzDrawPolygon[very thick](A,B,C)
  \tkzDrawLines[dotted](N,A N,B N,C)
  \tkzDrawLines[dashed](M,a M,b M,c)
  \tkzMarkRightAngles(M,a,B M,b,C M,c,C)
  \tkzDrawPoints(A,B,C,M,N,a,b,c)
  \tkzLabelPoints[below left](A,M,a,c)
  \tkzLabelPoints[below right](B)
  \tkzLabelPoints[above](C,b)
  \tkzLabelPoints[below](N)
\end{tikzpicture}
\end{document}
Click to download: triangle-circles.textriangle-circles.pdf
Open in Overleaf: triangle-circles.tex