TransWikia.com

How to draw a circle with a triangle in TikZ?

TeX - LaTeX Asked by Hinn on June 13, 2021

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!

enter image description here

3 Answers

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}

enter image description here

Correct answer by Mark Wibrow on June 13, 2021

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}
newsaveboxIBox

begin{document}
begin{CJK}{UTF8}{bsmi}
saveboxIBox{中}

begin{pspicture}[showgrid=false](5.75,4.25)
    pstGeonode[PosAngle={180,135,-45},PointName={useboxIBox,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}

enter image description here

Playing with Chinese characters

documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-eucl}
usepackage{CJKutf8}
newsaveboxIBoxO
newsaveboxIBoxA
newsaveboxIBoxB
newsaveboxIBoxC
newsaveboxIBoxD
newsaveboxIBoxE

begin{document}
begin{CJK}{UTF8}{bsmi}
saveboxIBoxO{中}
saveboxIBoxA{北}
saveboxIBoxB{南}
saveboxIBoxC{東}
saveboxIBoxD{北東部}
saveboxIBoxE{東北}

begin{pspicture}[showgrid=false](6,4.25)
    pstGeonode[PosAngle={180,150,155,185},
        PointName={useboxIBoxO,useboxIBoxA,useboxIBoxB,useboxIBoxC}]
        (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=useboxIBoxE]{C}{E'}{A}{D'}{E}
    pstGeonode[PosAngle=50,PointName=useboxIBoxD](D'){D}
    pstCircleOA{O}{A}
    pspolygon(A)(B)(D)
    pspolygon(A)(C)(E)
end{pspicture}

end{CJK}
end{document}

enter image description here

Answered by kiss my armpit on June 13, 2021

This is a nice one to do with Metapost. This is wrapped up in luamplib, so compile it with lualatex.

enter image description here

documentclass[border=5mm]{standalone}
usepackage{luamplib}
begin{document}
mplibtextextlabel{enable}
begin{mplibcode}
beginfig(1);
    numeric t; t = 5.25;
    path O; O = fullcircle scaled 144 rotated 100;

    z.A = point 0 of O;
    z.B = point 4 of O;
    z.C = point t of O;
    z.D = z.B reflectedabout(z.A, z.C);
    z.E = whatever[z.A, z.D];
    z.E - z.C = whatever * direction t of O;

    draw O withcolor 2/3 blue;
    draw z.A -- z.B -- z.D -- z.A -- z.C -- z.E;

    dotlabel.llft("$O$", origin);
    forsuffixes @=A, B, C, D, E: 
        drawdot z@ withpen pencircle scaled dotlabeldiam;
        label("$" & str @ & "$", z@ scaled ((abs z@ + 8) / abs z@) shifted up);
    endfor

    label.urt("$BC=CD$, $CE$ is tangent to $O$", (x.C - 12, y.B)) withcolor 2/3 red;
endfig;
end{mplibcode}
end{document}

Answered by Thruston on June 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