TransWikia.com

How to draw these circles using tkz-euclide?

TeX - LaTeX Asked by Alejandra Benítez on January 13, 2021

I’m learning how to use tkz-euclide. I want to draw these circles.

enter image description here

One Answer

enter image description here

enter image description here

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}

Second Circle

enter image description here

enter image description here

The preamble for the code remains the same

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}

Correct answer by js bibra on January 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP