答案1
答案2
无需神奇数字(零除外)和角度计算的解决方案。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
% The corners of the triangle
% \Ay and \Cx are the length of the catheti of the right-angled triangle
% and the radius for the circles in A and C.
\def\Ay{2cm}
\def\Cx{2cm}
\path
(0, \Ay) coordinate (A)
(0, 0) coordinate (B)
(\Cx, 0) coordinate (C)
;
% The areas are filled by filling the two circles in A and B.
% Because of the "even odd rule", the intersection is not filled.
% The fill areas are limited to the triangle by clipping.
% The local overlay removes the larger circles from the bounding
% box calculations for the whole tikzpicture.
\begin{scope}[overlay]
\clip (A) -- (B) -- (C) -- cycle;
\fill[even odd rule]
(A) circle[radius=\Ay]
(C) circle[radius=\Cx]
;
\end{scope}
% The triangle is drawn.
\draw (A) -- (B) -- (C) -- cycle;
% The annotations with the point names.
\path
(A) node[above left] {$A$}
(B) node[below left] {$B$}
(C) node[below right] {$C$}
% The coordinates for D and E are calculated
% via the syntax of distance modifiers.
($(C)!\Cx!0:(A)$) coordinate (D) node[above right] {$D$}
($(A)!\Ay!0:(C)$) coordinate (E) node[above right] {$E$}
;
\end{tikzpicture}
\end{document}
答案3
与 percusse 的解决方案相比,它太冗长了,但我希望,它不是那么神秘。
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) coordinate[label=above left:$A$] (A) --++(-90:2cm) coordinate[label=below left:$B$] (B) --++(0:2cm) coordinate[label=below right:$C$] (C) --cycle;
\fill (A)--(B) arc (180:135:2cm) coordinate[label=above right:$D$] (D)--cycle;
\fill (C)--(B) arc (-90:-45:2cm) coordinate[label=above right:$E$] (E)--cycle;
\end{tikzpicture}
\end{document}