\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\geometry{verbose}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.9]
\draw[thick] (0,0) -- (0,3) -- (4,0)-- (0,0);
\filldraw[thick, fill=white] (0,3) arc (90:270: 1.5);
\filldraw[thick, fill=white] (0,0) arc (180:360: 2);
\filldraw[black] (0,0) node[below left] {$B$};
\filldraw[black] (0,3) node[above left] {$A$};
\filldraw[black] (4,0) node[anchor=west] {$C$};
\end{tikzpicture}
\end{center}
\end{document}
到目前为止,我已经制作了三角形并标记了点,但是如何绘制半圆呢?
答案1
我很乐意删除这个,但由于我有这个轻微的扩展这个答案在我的计算机上,我也可以直接发布它。这定义了一种样式,用于semicircle
测量路径的长度和角度并相应地放置弧线。如果您希望它位于路径的另一侧,请添加yscale=-1
。
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.9,pics/semicircle/.style={code={
\draw (0,0) arc[start angle=180,end angle=0,radius=#1/2];}},
semicircled/.style={to path={let \p1=(\tikztostart),
\p2=(\tikztotarget),\n1={veclen(\x1-\x2,\y1-\y2)},
\n2={atan2(\y2-\y1,\x2-\x1)} in
(\p1) pic[rotate=\n2,transform shape]{semicircle=\n1}
}},bullet/.style={fill,inner sep=1.2pt,circle}]
%
\draw (0,3) node[bullet,label=above left:{$A$}](A){}
-- (0,0) node[bullet,label=below left:{$B$}](B){}
edge[semicircled] (A)
-- (4,0) node[bullet,label=below right:{$C$}](C) {}
edge[semicircled] (B)
edge[semicircled,yscale=-1] (A)
--cycle;
\end{tikzpicture}
\end{center}
\end{document}