tikz.dev / tkz-euclide Manual

tkz-euclide

Circles

17 Circles

Among the following macros, one draws a circle, which is not a real feat: you need the center of the circle and either its radius or a point of the circle. The most frequent use seemed to me to be a circle with a given center through a given point; this is the default, otherwise you use the option R. There are many special circles, for example the circumcircle of a triangle.

17.1 Characteristics of a circle: \tkzDefCircle

This macro gives the characteristics (center and radius) of some circles.

  • \tkzDefCircle[⟨local options⟩](⟨A,B⟩) or (⟨A,B,C⟩)


  • ☞ 💣 Note that the arguments are lists of two or three points. The macro is used either with
    \tkzGetPoints, to get the center and a point of the circle, or directly with
    tkzFirstPointResult and tkzSecondPointResult if you don’t need to keep the results. \tkzGetLength gives the radius.

    argumentsexampleexplanation
    (⟨pt1,pt2⟩) or (⟨pt1,pt2,pt3⟩)(⟨A,B⟩)\([AB]\) is radius \(A\) is the center
    optionsdefaultdefinition
    Rcircumcircle characterized by a center and a radius
    diametercircumcircle characterized by two points defining a diameter
    circumcircumcircle circumscribed of a triangle
    incircumincircle a triangle
    excircumexcircle of a triangle
    euler or ninecircumEuler’s Circle
    spiekercircumSpieker Circle
    apolloniuscircumcircle of Apollonius
    orthogonal fromcircum[orthogonal from = A ](O,M)
    orthogonal throughcircum[orthogonal through = A and B](O,M)
    K1coefficient used for a circle of Apollonius

    In the following examples, I draw the circles with a macro not yet presented. You may only need the center and a point of the circle.

17.1.1 Example with option R

With the macro \tkzGetPoint we get a point of the circle, its "east pole".

Compiled output

\begin{tikzpicture}[scale=1]
\tkzDefPoint(3,3){C}
\tkzDefPoint(5,5){A}
\tkzCalcLength(A,C) \tkzGetLength{rAC}
\tkzDefCircle[R](C,\rAC) \tkzGetPoint{B}
\tkzDrawCircle(C,B)
\tkzDrawSegment(C,A)
\tkzLabelSegment[above left](C,A){$2\sqrt{2}$}
\tkzDrawPoints(A,B,C)
\tkzLabelPoints(A,C,B)
\end{tikzpicture}
17.1.2 Example with option diameter

It is simpler here to search directly for the midpoint of \([AB]\). The result is the center and if necessary

Compiled output

\begin{tikzpicture}
\tkzDefPoint(0,0){O}
\tkzDefPoint(2,2){B}
\tkzDefCircle[diameter](O,B) \tkzGetPoint{A}
\tkzDrawCircle(A,B)
\tkzDrawPoints(O,A,B)
\tkzDrawSegment(O,B)
\tkzLabelPoints(O,A,B)
\tkzLabelSegment[above left](O,A){$\sqrt{2}$}
\tkzLabelSegment[above left](A,B){$\sqrt{2}$}
\tkzMarkSegments[mark=s||](O,A A,B)
\end{tikzpicture}
17.1.3 Circles inscribed and circumscribed for a given triangle

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoint(2,2){A} \tkzDefPoint(5,-2){B}
\tkzDefPoint(1,-2){C}
\tkzDefCircle[in](A,B,C)
\tkzGetPoints{I}{x}
\tkzDefCircle[circum](A,B,C)
\tkzGetPoint{K}
\tkzDrawCircles[new](I,x K,A)
\tkzLabelPoints[below](B,C)
\tkzLabelPoints[above left](A,I,K)
\tkzDrawPolygon(A,B,C)
\tkzDrawPoints(A,B,C,I,K)
\end{tikzpicture}
17.1.4 Example with option ex

We want to define the excircle of a triangle opposite the vertex \(C\).

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoints{ 0/0/A,4/0/B,0.8/4/C}
\tkzDefCircle[ex](B,C,A)
\tkzGetPoints{J_c}{h}
\tkzDefPointBy[projection=onto A--C ](J_c)
\tkzGetPoint{X_c}
\tkzDefPointBy[projection=onto A--B ](J_c)
\tkzGetPoint{Y_c}
\tkzDefCircle[in](A,B,C)
\tkzGetPoints{I}{y}
\tkzDrawCircles[color=lightgray](J_c,h I,y)
\tkzDefPointBy[projection=onto A--C ](I)
\tkzGetPoint{F}
\tkzDefPointBy[projection=onto A--B ](I)
\tkzGetPoint{D}
\tkzDrawPolygon(A,B,C)
\tkzDrawLines[add=0 and 1.5](C,A C,B)
\tkzDrawSegments(J_c,X_c I,D I,F J_c,Y_c)
\tkzMarkRightAngles(A,F,I B,D,I J_c,X_c,A
J_c,Y_c,B)
\tkzDrawPoints(B,C,A,I,D,F,X_c,J_c,Y_c)
\tkzLabelPoints(B,A,J_c,I,D)
\tkzLabelPoints[above](Y_c)
\tkzLabelPoints[left](X_c)
\tkzLabelPoints[above left](C)
\tkzLabelPoints[left](F)
\end{tikzpicture}
17.1.5 Euler’s circle for a given triangle with option euler

We verify that this circle passes through the midpoint of each side.

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoint(5,3.5){A}
\tkzDefPoint(0,0){B} \tkzDefPoint(7,0){C}
\tkzDefCircle[euler](A,B,C)
\tkzGetPoints{E}{e}
\tkzDefSpcTriangle[medial](A,B,C){M_a,M_b,M_c}
\tkzDrawCircle[new](E,e)
\tkzDrawPoints(A,B,C,E,M_a,M_b,M_c)
\tkzDrawPolygon(A,B,C)
\tkzLabelPoints[below](B,C)
\tkzLabelPoints[left](A,E)
\end{tikzpicture}
17.1.6 Apollonius circles for a given segment: option apollonius

Compiled output

\begin{tikzpicture}[scale=0.75]
\tkzDefPoint(0,0){A}
\tkzDefPoint(4,0){B}
\tkzDefCircle[apollonius,K=2](A,B)
\tkzGetPoints{K1}{x}
\tkzDrawCircle[color = teal!50!black,
fill=teal!20,opacity=.4](K1,x)
\tkzDefCircle[apollonius,K=3](A,B)
\tkzGetPoints{K2}{y}
\tkzDrawCircle[color=orange!50,
fill=orange!20,opacity=.4](K2,y)
\tkzLabelPoints[below](A,B,K1,K2)
\tkzDrawPoints(A,B,K1,K2)
\tkzDrawLine[add=.2 and 1](A,B)
\end{tikzpicture}
17.1.7 Excircles of a given triangle: option ex

You can also get the center and its projection on one side of the triangle

with \tkzGetFirstPoint{Jb} and \tkzGetSecondPoint{Tb}.

Compiled output

\begin{tikzpicture}[scale=.6]
\tkzDefPoint(0,0){A}
\tkzDefPoint(3,0){B}
\tkzDefPoint(1,2.5){C}
\tkzDefCircle[ex](A,B,C) \tkzGetPoints{I}{i}
\tkzDefCircle[ex](C,A,B) \tkzGetPoints{J}{j}
\tkzDefCircle[ex](B,C,A) \tkzGetPoints{K}{k}
\tkzDefCircle[in](B,C,A) \tkzGetPoints{O}{o}
\tkzDrawCircles[new](J,j I,i K,k O,o)
\tkzDrawLines[add=1.5 and 1.5](A,B A,C B,C)
\tkzDrawPolygon[purple](I,J,K)
\tkzDrawSegments[new](A,K B,J C,I)
\tkzDrawPoints(A,B,C)
\tkzDrawPoints[new](I,J,K)
\tkzLabelPoints(A,B,C,I,J,K)
\end{tikzpicture}
17.1.8 Spieker circle with option spieker

The incircle of the medial triangle \(M_aM_bM_c\) is the Spieker circle:

Compiled output

\begin{tikzpicture}[scale=1.25]
\tkzDefPoints{ 0/0/A,4/0/B,0.8/4/C}
\tkzDefSpcTriangle[medial](A,B,C){M_a,M_b,M_c}
\tkzDefTriangleCenter[spieker](A,B,C)
\tkzGetPoint{S_p}
\tkzDrawPolygon(A,B,C)
\tkzDrawPolygon[cyan](M_a,M_b,M_c)
\tkzDrawPoints(B,C,A)
\tkzDefCircle[spieker](A,B,C)
\tkzDrawPoints[new](M_a,M_b,M_c,S_p)
\tkzDrawCircle[new](tkzFirstPointResult,%
tkzSecondPointResult)
\tkzLabelPoints[right](M_a)
\tkzLabelPoints[left](M_b)
\tkzLabelPoints[below](A,B,M_c,S_p)
\tkzLabelPoints[above](C)
\end{tikzpicture}
17.2 Projection of excenters
  • \tkzDefProjExcenter[⟨local options⟩](⟨A,B,C⟩)(⟨a,b,c⟩){⟨X,Y,Z⟩}

  • Each excenter has three projections on the sides of the triangle \(ABC\). We can get them all with one macro:
    \tkzDefProjExcenter[name=J](A,B,C)(a,b,c){Y,Z,X}.

    optionsdefaultdefinition
    nameno defautused to name the vertices
    argumentsdefaultdefinition
    (pt1=\(\alpha_1\),pt2=\(\alpha_2\),…)no defaultEach point has a assigned weight
17.2.1 Excircles

Compiled output

\begin{tikzpicture}[scale=.6]
\tikzset{line style/.append style={line width=.2pt}}
\tikzset{label style/.append style={color=teal,font=\footnotesize}}
\tkzDefPoints{0/0/A,5/0/B,0.8/4/C}
\tkzDefSpcTriangle[excentral,name=J](A,B,C){a,b,c}
\tkzDefSpcTriangle[intouch,name=I](A,B,C){a,b,c}
\tkzDefProjExcenter[name=J](A,B,C)(a,b,c){X,Y,Z}
\tkzDefCircle[in](A,B,C) \tkzGetPoint{I} \tkzGetSecondPoint{T}
\tkzDrawCircles[red](Ja,Xa Jb,Yb Jc,Zc)
\tkzDrawCircle(I,T)
\tkzDrawPolygon[dashed,color=blue](Ja,Jb,Jc)
\tkzDrawLines[add=1.5 and 1.5](A,C A,B B,C)
\tkzDrawSegments(Ja,Xa Ja,Ya Ja,Za
Jb,Xb Jb,Yb Jb,Zb
Jc,Xc Jc,Yc Jc,Zc
I,Ia I,Ib I,Ic)
\tkzMarkRightAngles[size=.2,fill=gray!15](Ja,Za,B Ja,Xa,B Ja,Ya,C Jb,Yb,C)
\tkzMarkRightAngles[size=.2,fill=gray!15](Jb,Zb,B Jb,Xb,C Jc,Yc,A Jc,Zc,B)
\tkzMarkRightAngles[size=.2,fill=gray!15](Jc,Xc,C I,Ia,B I,Ib,C I,Ic,A)
\tkzDrawSegments[blue](Jc,C Ja,A Jb,B)
\tkzDrawPoints(A,B,C,Xa,Xb,Xc,Ja,Jb,Jc,Ia,Ib,Ic,Ya,Yb,Yc,Za,Zb,Zc)
\tkzLabelPoints(A,Ya,Yb,Ja,I)
\tkzLabelPoints[left](Jb,Ib,Yc)
\tkzLabelPoints[below](Zb,Ic,Jc,B,Za,Xa)
\tkzLabelPoints[above right](C,Zc,Yb)
\tkzLabelPoints[right](Xb,Ia,Xc)
\end{tikzpicture}
17.2.2 Orthogonal from

Circle with a given center, orthogonal to a given circle. \tkzGetPoints{z1}{z2} gives two points of the circle.

Compiled output

\begin{tikzpicture}[scale=.75]
\tkzDefPoints{0/0/O,1/0/A}
\tkzDefPoints{1.5/1.25/B,-2/-3/C}
\tkzDefCircle[orthogonal from=B](O,A)
\tkzGetPoints{z1}{z2}
\tkzDefCircle[orthogonal from=C](O,A)
\tkzGetPoints{t1}{t2}
\tkzDrawCircle(O,A)
\tkzDrawCircles[new](B,z1 C,t1)
\tkzDrawPoints(t1,t2,C)
\tkzDrawPoints(z1,z2,O,A,B)
\tkzLabelPoints[right](O,A,B,C)
\end{tikzpicture}
17.2.3 Orthogonal through

Circle orthogonal to a given circle, through two given points.

Compiled output

\begin{tikzpicture}[scale=1]
\tkzDefPoint(0,0){O}
\tkzDefPoint(1,0){A}
\tkzDrawCircle(O,A)
\tkzDefPoint(-1.5,-1.5){z1}
\tkzDefPoint(1.5,-1.25){z2}
\tkzDefCircle[orthogonal through=z1 and z2](O,A)
\tkzGetPoint{c}
\tkzDrawCircle[new](tkzPointResult,z1)
\tkzDrawPoints[new](O,A,z1,z2,c)
\tkzLabelPoints[right](O,A,z1,z2,c)
\end{tikzpicture}