# How can I draw the figure below using tikz in latex?

How can I draw this figure please using tikz in LaTeX?

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw (0,0) -- (1.5cm,0);
\draw (0,-1.5cm) -- (0,1.5cm);
\end{tikzpicture}

\end{document}

• You can do it easily by using tkz-euclide package. You can refer manual for different examples. (from @Krishna) Commented Apr 10, 2023 at 11:28
• The figure is false with $1^2+1^2=1.5^2$. Commented Apr 10, 2023 at 14:01
• Please give your question a more meaningful title. Maybe "How can I draw two orthogonal circles?" (if that is what you want!) Commented Apr 11, 2023 at 8:57
• Thank you all for the help Commented Apr 12, 2023 at 18:54

Solution 1 )

The question is not specific enough to give the right construction. I will defend my tkz-euclide package here because if you have only one construction then TikZ is perfect but if you are considering other figures of this type or if you want to adapt the solution then I think tkz-euclide is better.

It would be necessary to know what the data are. For example if the circle C1 is given as well as the point C2 then the problem is to find the circle orthogonal to the circle of center C1 and center C2.

 \documentclass{article}
\usepackage{tkz-euclide}
\begin{document}

\begin{tikzpicture}[scale=.4]
\tkzDefPoints{0/0/C_1,5/0/A,8/0/C_2}
\tkzDefCircle[orthogonal from=C_2](C_1,A)
\tkzGetSecondPoint{T}

\tkzDrawCircles(C_1,T C_2,T)
\tkzDrawSegments(C_1,T C_2,T)
\tkzDrawLine(C_1,C_2)
\tkzMarkRightAngle[fill=teal,opacity=.2,size=1](C_1,T,C_2)
\tkzDrawPoints(C_1,C_2,T)
\tkzLabelPoints(C_1,C_2)
\tkzLabelPoints[above](T)
\tkzLabelSegment[left](C_1,T){r}
\tkzLabelSegment[right](C_2,T){\gamma}
\tkzLabelSegment[below](C_1,C_2){d}
\tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
\tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
\end{tikzpicture}

\end{document}


Now if the information is different, we can consider other constructions. It would be interesting if you could provide all the necessary information.

It should be noted here that finally after one line of point definition there is only one line of calculation.

Note that if you change a single piece of data you don't have to change anything except the data that has changed.

Solution 2)

If the data are the points C_1 and C_2 with two circles of the same radius, it is enough to replace the first lines by :

\tkzDefPoints{-4/0/C_1,4/0/C_2,0/0/O}
\tkzDefLine[mediator](C_1,C_2)  \tkzGetPoints{x}{y}
\tkzInterLC(x,y)(O,C_2) \tkzGetPoints{T}{S}


Here is a solution with tkz-elements a package I am finalizing that allows to do the calculations only with lua. If you prefer to use TikZ instead of tkz-euclide then just replace what is in the tikzpicture environment.

 \documentclass{article}
\usepackage{tkz-euclide,tkz-elements}
\begin{document}

\begin{elements}
scale = .6
z.C_1 = point: new (0,0)
z.C_2 = point: new (8,0)
z.A = point: new (5,0)
C = circle: new (z.C_1,z.A)
z.S,z.T = C: orthogonal_from (z.C_2)
\end{elements}

\begin{tikzpicture}
\tkzGetNodes

\tkzDrawCircles(C_1,T C_2,T)
\tkzDrawSegments(C_1,T C_2,T)
\tkzDrawLine(C_1,C_2)
\tkzMarkRightAngle[fill=teal,opacity=.2,size=1](C_1,T,C_2)
\tkzDrawPoints(C_1,C_2,T)
\tkzLabelPoints(C_1,C_2)
\tkzLabelPoints[above](T)
\tkzLabelSegment[left](C_1,T){r}
\tkzLabelSegment[right](C_2,T){\gamma}
\tkzLabelSegment[below](C_1,C_2){d}
\tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
\tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
\end{tikzpicture}

\end{document}

• Hi, I have an error without $ around \gamma... ;-) (first code) Commented Apr 10, 2023 at 14:07 • @Rmano We may have different configuration files but you are right in principle it is necessary to be in math mode. Commented Apr 10, 2023 at 14:25 • Yep, I tried it with a plain TeXLive installation, never changed anything about tkz-euclide ;-) Commented Apr 10, 2023 at 14:44 • @Rmano I have no error because I compile with lualatex but with pdflatex $$ are necessary. I don't know why! Commented Apr 10, 2023 at 14:52 • @AlainMatthes (+1) for your precise code. Your elements package is interesting. Commented Apr 10, 2023 at 16:29 as a preliminary, on this forum it is desirable to show that one tried by proposing a minimal code. Otherwise here is a solution that uses different possibilities of Tikz. The code is commented and I invite you to find in the documentation the different tools used \documentclass[11pt]{article} %\usepackage[margin=1cm]{geometry} \usepackage{tikz} \usetikzlibrary{calc,intersections,angles} \begin{document} \begin{tikzpicture} %Drawing of the first circle \draw[red,name path=circleA] (0,0) coordinate(C1) circle (4cm); %first segment from C1 (arbitrary angle, end noted C3) \draw [dashed] (C1) -- (50:4) coordinate(C3); %path of an orthogonal segment from end C3 \draw[dashed,name path=lineC3] (C3)-- ($(C3)!6cm!90:(C1)$); %drawing a segment from C1 \draw[dashed, name path=lineC1] (C1) -- ++(10cm,0); %Determination of the intersection of the two segments (noted C2) \path[name intersections={of=lineC1 and lineC3, by=C2}]; %calculating the distance between C2 and C3 and drawing the circle with radius C2C3 \draw[blue] let \p1 = ($ (C2) - (C3) $), \n2 = {veclen(\x1,\y1)} in (C2) circle (\n2); %Drawing of the triangle (indications of points and distances) \draw[thick] (C1)node[below]{$C_1$} -- node[sloped,above]{$R$}(C3) -- node[sloped,above]{$r$}(C2) node[below]{$C_2$} -- node[below]{$d$} cycle; %ortho symbol plot \draw pic [draw,red,thick] {right angle = C1--C3--C2}; \end{tikzpicture} \end{document}  You can do it easily by using tkz-euclide package. You can refer manual for different examples. You can change the radius of circles by changing the values of coordinates. \documentclass[border=5mm]{standalone} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture}[scale=0.4] \tkzSetUpLine[line width=1pt] \tkzSetUpLabel[font=\normalsize,black] % \tkzSetUpStyle[red,auto]{label style} \tkzSetUpPoint[size=2,color=black] \tkzDefPoint(0,0){C1} \tkzDefPoint(7,0){A} \tkzDefPoint(10,0){C2} \tkzDefPoint(3,0){B} \tkzDrawCircle[very thick,black](C1,A) \tkzDrawCircle[very thick,black](C2,B) \tkzInterCC(C1,A)(C2,B) \tkzGetFirstPoint{I} \tkzDrawSegments(C1,C2 C1,I C2,I) \tkzMarkRightAngle[size=1, thick](C1,I,C2) \tkzLabelPoint[below left](C1){$$C_1$$} \tkzLabelPoint[below right](C2){$$C_2$$} \tkzLabelSegment[left](C1,I){R} \tkzLabelSegment[right](C2,I){r} \tkzLabelSegment[below](C1,C2){d} \tkzLabelCircle[left=10pt](C1,A)(180){Circle 1} \tkzLabelCircle[right=10pt](C2,B)(180){Circle 2} \end{tikzpicture} \end{document}  • I have added your comment @Krishna, if you want to delete this then go ahead :) Commented Apr 10, 2023 at 11:29 I am not sure if you wanted the construction with the right angle at the top (it seems that that was the case, given everybody's answer 😜); still, the following code could be useful because it shows how to find the angle between segments and how to print it. You can play around with the values... \documentclass[border=2.72mm]{standalone} \usepackage[T1]{fontenc} \usepackage{tikz} \usetikzlibrary{calc,intersections,angles} \begin{document} \begin{tikzpicture}[declare function={ d=4*sqrt(2)*1.2; r1=4; r2=4; }] \draw [cyan, thin] (0,0) coordinate(A) node[fill,circle,label=above:A]{} -- (d,0) coordinate(B) node[fill,circle,label=above:B]{}; \draw [thin, name path=circleA] (A) circle[radius=r1]; \draw [thin, name path=circleB] (B) circle[radius=r2]; \path [name intersections={of=circleA and circleB, name=I}] (I-1) node[fill,circle,label=above:I]{}; \draw [thick] (A) -- (I-1) -- (B); \pic [draw, red, <->, angle radius=5mm] {angle=A--I-1--B}; \pgfmathanglebetweenlines {\pgfpointanchor{A}{center}}{\pgfpointanchor{I-1}{center}} {\pgfpointanchor{B}{center}}{\pgfpointanchor{I-1}{center}} \edef\angle{\pgfmathresult} \node [below=1cm, fill=white, inner sep=1pt] at (I-1) {\angle}; \end{tikzpicture} \end{document}  For the square angle, you can try...  d=4*sqrt(2); r1=4; r2=4;  An answer with a little trigonometry, which accepts different values for the radii. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \def\Radius{1.2} \def\radius{1.6} %% If a right triangle is required, keep the line calculation below. Otherwise, choose an arbitrary value for the distance between centers. \pgfmathsetmacro\CenterDistance{(\Radius^2+\radius^2)^0.5} \def\ss{0.2} \pgfmathsetmacro\theta{acos((\Radius^2+\CenterDistance^2-\radius^2)/(2*\CenterDistance*\Radius))} \pgfmathsetmacro\height{\Radius*sin(\theta)} \pgfmathsetmacro\mLeg{\Radius*cos(\theta)} \draw[thick] (0,0) node[left] {$C_1$} circle (\Radius); \node[below left] at (210:\Radius) {Circle 1}; \draw[thick] (\CenterDistance,0) node[right] {$C_2$} circle (\radius); \path (\CenterDistance,0) ++ (-30:\radius) node[below right]{Circle 2}; \draw[thick] (0,0) -- (\CenterDistance,0) -- node[above right] {$r$} (\mLeg,\height) -- node[above left] {$R$} cycle; \node[below] at (\mLeg,0) {$d$}; %% If it is not a right triangle, delete the two lines below. \draw[thick] (0,0) (\mLeg,\height) -- ([turn]-90:\ss) coordinate (aa) -- ([turn]-90:\ss) -- ([turn]-90:\ss) coordinate (bb); \fill ($(aa)!0.5!(bb)\$) circle (0.03);
\end{tikzpicture}
\end{document}