With some mathematics... I tried to use useful names for the variables: radius, side of the equilateral triangle (since the initial angle is \asrt=45
), and various angles. If it is not clear, let me know.
Remark
I updated the code; there are three variables: the radius \r
, the initial angle \asrt
, and the correcting angle \adif
needed to obtain the rounded corners. Note that the rounded corners
does not work correctly if \adif=3
for example.
The code
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, math}
\begin{document}
\begin{tikzpicture}[%
evaluate={%
\r = 2.8;
\s\asrt = \r/pow(2, .5);45;
\asrt\aend = 45;180 -\asrt;
\aend\adif = 135;5;
\adif\s = 5;\r*sin(\asrt);
}]
\draw [help lines] (-2, -2) grid (2, 2);
\draw[blue] (-2.5, 0) -- (2.5, 0);
\draw[red, rounded corners, fill=cyan!20]
($(0, -\s) +(\asrt +\adif: \r)$)
arc (\asrt +\adif:\aend -\adif: \r)
-- ($(0, \s) +(-\aend +\adif: \r)$)
arc (-\aend +\adif:-\asrt -\adif: \r) -- cycle;
\end{tikzpicture}
\end{document}