如何使用 tkz-euclide 绘制这些圆圈?

如何使用 tkz-euclide 绘制这些圆圈?

我正在学习如何使用 tkz-euclide。我想画这些圆圈。

在此处输入图片描述

答案1

在此处输入图片描述

在此处输入图片描述

\documentclass{article} % or another class
\usepackage{xcolor} % before tikz or tkz-euclide if necessary

\usepackage{tkz-euclide} % no need to load TikZ
\usepackage{multirow}
\usetikzlibrary{babel} %if there are problems with the active characters
\begin{document}
\begin{tikzpicture}
    %arbitrary points
    \tkzDefPoint(0,4){A}
    \tkzDefPoint(2,2){B}
    %tangent to circle
%   \tkzDrawLine(A,B)%--------uncomment to show line
    %mid point of tangent line
    \tkzDefMidPoint(B,A)\tkzGetPoint{P}
    %perpendicular to tangent
    \tkzDefLine[orthogonal =through P](B,A)\tkzGetPoint{X}
    \tkzDrawSegment(P,X)
    \tkzLabelPoints(X)
    %drw circle with radius XP
    \tkzDefCircle[through](X,P)
    \tkzGetLength{rXPpt}
    \tkzpttocm(\rXPpt){rXPcm}
    \tkzDrawCircle(X,P)
    %define radius of smaller circle
    \tkzDefPointWith[linear,K=0.3](X,P) \tkzGetPoint{x}
    \tkzLabelPoints(x)
    %draw smaller circle
    \tkzDefCircle[through](x,P)
    \tkzGetLength{rxPpt}
    \tkzpttocm(\rxPpt){rxPcm}
    \tkzDrawCircle(x,P)
    %labelling radius r1 
    \tkzDrawPoints(X,x)
    \tkzDrawSegment[<->, >=triangle 45](x,P)
    \tkzLabelLine[pos=0.5,left](x,P){r1}
    %label radius r
    \tkzCalcLength[cm](X,P)\tkzGetLength{rXP}
    \tkzDefShiftPoint[X](-90:\rXP){y}
    \tkzDrawSegments[<->, >=triangle 45](X,y)  
    \tkzLabelLine[pos=0.5,left](X,y){r} 
    
\end{tikzpicture}
\end{document}

第二圈

在此处输入图片描述

在此处输入图片描述

守则的序言保持不变

\begin{tikzpicture}[scale=0.55]
%arbitrary points
\tkzDefPoint(6,4){A}
\tkzDefPoint(6,-4){B}
%tangent to circle
%\tkzDrawLine(A,B)%--------uncomment to show line
%mid point of tangent line
\tkzDefMidPoint(B,A)\tkzGetPoint{P}
%perpendicular to tangent
\tkzDefLine[orthogonal =through P](A,B)\tkzGetPoint{X}
\tkzDrawSegment[<->, >=triangle 45](P,X)
\tkzLabelPoints[above](X)
%drw circle with radius XP
\tkzDefCircle[through](X,P)
\tkzDrawCircle(X,P)
%perpendicular to tangent
\tkzCalcLength[cm](X,P)\tkzGetLength{rXP}
\tkzDefShiftPoint[X](180:\rXP*2){y}
%define radius of smaller circle
\tkzDefPointWith[linear,K=0.3](y,P) \tkzGetPoint{x}
\tkzLabelPoints[above](x)
\tkzDrawSegment[<->, >=triangle 45](P,x)
%drw circle with radius XP
\tkzDefCircle[through](x,P)
\tkzDrawCircle(x,P)
%label
\tkzLabelLine[pos=0.5,above](x,P){r1}
\tkzCalcLength[cm](X,P)\tkzGetLength{rXP}
\tkzDefShiftPoint[X](-60:\rXP){X'}
\tkzDrawSegments[<->, >=triangle 45](X,X')  
\tkzLabelLine[pos=0.5,above, sloped](X,X'){r}
\tkzDrawPoints(X,x) 

\end{tikzpicture}

相关内容