# How to draw a circle with a triangle in TikZ?

Be sorry that I cannot provide the coordinates of all points, or I can draw the picture. How can I make this figure? Thanks for any help!

• Why you don't use [Geogebra][1]? You an draw it and get it's Tikz code. [1][geogebra.org/cms/en/] – Hoseyn Heydari Nov 16 '13 at 7:42
• Already tried »tkz-euclide«? – Thorsten Donig Nov 16 '13 at 7:44
• That's a good idea. But now I want to try to use tex as much as possible. It is more interesting to accomplish it. Thank you! – Hinn Nov 16 '13 at 7:45
• @ThorstenDonig No, I know little about tkz-euclide. Next I will click your link to learn something new. Thanks! – Hinn Nov 16 '13 at 7:47
• @HoseynHeydari Wow, I don't know that I can get its TikZ code. That's good!^0^ – Hinn Nov 16 '13 at 7:48

In this case it is pretty simple to use the calc and intersections library:

\documentclass[tikz,border=0.125cm]{standalone}

\usetikzlibrary{calc,intersections}

\begin{document}

\begin{tikzpicture}

\path [rotate=60]
(0,0)   coordinate (A)
(-2,-3) coordinate (B)
(0,-3)  coordinate (C)
($(B)!2!(C)$)   coordinate (D)
($(A)!0.5!(B)$) coordinate (O);

\path [name path=first]  (A) -- (D);
\path [name path=second] (C) -- ($(C)!1!-90:(O)$);

\path [name intersections={of=first and second}]
(intersection-1) coordinate (E);

\draw (A) -- (B) -- (C) -- (D) -- cycle;
\draw let \p1=(A), \p2=(O), \n1={veclen(\x2-\x1,\y2-\y1)} in (O) circle [radius=\n1];
\draw (A) -- (C);
\draw (C) -- (E);

\foreach \p/\a in {A/above,O/left,B/below,C/right,D/right,E/above}
\node [inner sep=1pt, circle, fill, label=\a:\p] at (\p) {};

\end{tikzpicture}

\end{document}


• What does it mean ($(A)!(C)!(D)$) coordinate (E)? – kiss my armpit Nov 16 '13 at 9:09
• @DonutE.Knot From A to D but go as much as projection of C on to AD See manual Section 13.5.5. – percusse Nov 16 '13 at 9:24
• @percusse: OK. Thanks. I have to learn geometry first to know that AD is perpendicular to CE when CE is a tangent to the circle at C. That is why I asked it. – kiss my armpit Nov 16 '13 at 9:32
• @DonutE.Knot thanks for pointing this out! I've corrected my answer now so the the OP doesn't have to read the manual or (at the time of writing) provide a MWE or do any thinking for themselves. This is (one presumes) the very essence of stack exchange. – Mark Wibrow Nov 16 '13 at 10:26
• @DonutE.Knot imagine you have drawn the radius OC and the tangent T. Call a the angle at C between the tangent and CA and b the angle at C between CA and CO so that a+b=90degrees. But b is also the angle at A between AO and AC hence also between AC and AD. Thus if E is the intersection of tangent T with line AD, the angle at E of triangle AEC is necessarily 90degrees because its two other angles are a and b and add up to 90degrees. – user4686 Nov 16 '13 at 10:48

A recommended solution with PSTricks (plus supporting Chinese characters as you are living in Macau, China), just for best-practitioners.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-eucl}
\usepackage{CJKutf8}
\newsavebox\IBox

\begin{document}
\begin{CJK}{UTF8}{bsmi}
\savebox\IBox{中}

\begin{pspicture}[showgrid=false](5.75,4.25)
\pstGeonode[PosAngle={180,135,-45},PointName={\usebox\IBox,default}]
(2,2){O}
([nodesep=2,angle=110]O){A}
([nodesep=2,angle=-70]O){B}
([nodesep=2,angle=-10]O){C}
\nodexn{2(C)-(B)}{D'}
\pnode([offset=3,nodesep=2]{C}O){E'}
\pstInterLL[PosAngle=90]{C}{E'}{A}{D'}{E}
\pstGeonode(D'){D}
\pstCircleOA{O}{A}
\pspolygon(A)(B)(D)
\pspolygon(A)(C)(E)
\end{pspicture}

\end{CJK}
\end{document}


## Playing with Chinese characters

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-eucl}
\usepackage{CJKutf8}
\newsavebox\IBoxO
\newsavebox\IBoxA
\newsavebox\IBoxB
\newsavebox\IBoxC
\newsavebox\IBoxD
\newsavebox\IBoxE

\begin{document}
\begin{CJK}{UTF8}{bsmi}
\savebox\IBoxO{中}
\savebox\IBoxA{北}
\savebox\IBoxB{南}
\savebox\IBoxC{東}
\savebox\IBoxD{北東部}
\savebox\IBoxE{東北}

\begin{pspicture}[showgrid=false](6,4.25)
\pstGeonode[PosAngle={180,150,155,185},
PointName={\usebox\IBoxO,\usebox\IBoxA,\usebox\IBoxB,\usebox\IBoxC}]
(2,2){O}
([nodesep=2,angle=110]O){A}
([nodesep=2,angle=-70]O){B}
([nodesep=2,angle=-10]O){C}
\nodexn{2(C)-(B)}{D'}
\pnode([offset=3,nodesep=2]{C}O){E'}
\pstInterLL[PosAngle=90,PointName=\usebox\IBoxE]{C}{E'}{A}{D'}{E}
\pstGeonode[PosAngle=50,PointName=\usebox\IBoxD](D'){D}
\pstCircleOA{O}{A}
\pspolygon(A)(B)(D)
\pspolygon(A)(C)(E)
\end{pspicture}

\end{CJK}
\end{document}